[X11] Fixed cursor position when CursorVisible becomes true
authorthefiddler <stapostol@gmail.com>
Tue, 13 May 2014 11:23:20 +0000 (13:23 +0200)
committerthefiddler <stapostol@gmail.com>
Tue, 13 May 2014 11:23:20 +0000 (13:23 +0200)
Source/OpenTK/Platform/X11/X11GLNative.cs

index 968a430..a5517af 100644 (file)
@@ -1499,6 +1499,10 @@ namespace OpenTK.Platform.X11
                 {
                     using (new XLock(window.Display))
                     {
+                        Point p = PointToScreen(new Point(MouseState.X, MouseState.Y));
+                        Mouse.SetPosition(p.X, p.Y);
+                        Functions.XFlush(window.Display);
+
                         // Note: if cursorHandle = IntPtr.Zero, this function
                         // is equivalent to XUndefineCursor.
                         Functions.XDefineCursor(window.Display, window.Handle, cursorHandle);