[PATCH 3/4] Cygwin/X: Allow pointer warping to work in rootless modes

Jon TURNEY jon.turney at dronecode.org.uk
Wed Jun 24 13:15:27 PDT 2009


Mouse pointer warping in multiwindow/rootless mode was never implemented,
due to concerns that moving the mouse pointer without asking might be rude

This patch allows X applications to move the mouse pointer in rootless modes,
Let's hope they don't abuse this privilege ;-)

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 hw/xwin/wincursor.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 9525608..bda057b 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -95,8 +95,16 @@ winPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
       return;
     }
 
-  /* Only update the Windows cursor position if we are active */
-  if (pScreenPriv->hwndScreen == GetForegroundWindow ())
+  /*
+     Only update the Windows cursor position if root window is active,
+     or we are in a rootless mode
+  */
+  if ((pScreenPriv->hwndScreen == GetForegroundWindow ())
+      || pScreenPriv->pScreenInfo->fRootless
+#ifdef XWIN_MULTIWINDOW
+      || pScreenPriv->pScreenInfo->fMultiWindow
+#endif
+      )
     {
       /* Get the client area coordinates */
       GetClientRect (pScreenPriv->hwndScreen, &rcClient);
-- 
1.6.1.2



More information about the xorg-devel mailing list