Permalink
Browse files

[X11] Fixed cursor position when CursorVisible becomes true

  • Loading branch information...
1 parent fc71802 commit 7e3b99c6369470a7f15fcf5e366a5d03656375e1 @thefiddler thefiddler committed May 13, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 Source/OpenTK/Platform/X11/X11GLNative.cs
@@ -1499,6 +1499,10 @@ public override bool CursorVisible
{
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);

0 comments on commit 7e3b99c

Please sign in to comment.