From 33529aff6312287a2956634d4dd0b27c24d61e39 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 20 Oct 2010 09:50:49 +0000 Subject: [PATCH] * Source/OpenTK/Platform/X11/X11GLNative.cs: Confine pointer to window when it becomes invisible. --- Source/OpenTK/Platform/X11/X11GLNative.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/OpenTK/Platform/X11/X11GLNative.cs b/Source/OpenTK/Platform/X11/X11GLNative.cs index 4277c54e..9ef2de18 100644 --- a/Source/OpenTK/Platform/X11/X11GLNative.cs +++ b/Source/OpenTK/Platform/X11/X11GLNative.cs @@ -1329,6 +1329,7 @@ namespace OpenTK.Platform.X11 { using (new XLock(window.Display)) { + Functions.XUngrabPointer(window.Display, IntPtr.Zero); Functions.XUndefineCursor(window.Display, window.WindowHandle); } } @@ -1337,6 +1338,11 @@ namespace OpenTK.Platform.X11 using (new XLock(window.Display)) { Functions.XDefineCursor(window.Display, window.WindowHandle, EmptyCursor); + Functions.XGrabPointer(window.Display, window.WindowHandle, true, + EventMask.PointerMotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask, + GrabMode.GrabModeAsync, GrabMode.GrabModeAsync, window.WindowHandle, IntPtr.Zero, + IntPtr.Zero); + } } }