[PATCH 5/8] mi: Call pScreen->ConstrainCursorHarder from the position update path

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 21 19:51:21 PST 2011


From: Adam Jackson <ajax at redhat.com>

v2: Cover more paths, spotted by Daniel Stone.
v3: pass down the mode field for movement mode.

Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Signed-off-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 mi/mipointer.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/mi/mipointer.c b/mi/mipointer.c
index 250d26b..466600f 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -253,6 +253,10 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
     SetupScreen (pScreen);
 
     GenerateEvent = generateEvent;
+
+    if (pScreen->ConstrainCursorHarder)
+	pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y);
+
     /* device dependent - must pend signal and call miPointerWarpCursor */
     (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);
     if (!generateEvent)
@@ -570,6 +574,9 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, int *x, int *y)
     if (*y >= pPointer->limits.y2)
 	*y = pPointer->limits.y2 - 1;
 
+    if (pScreen->ConstrainCursorHarder)
+       pScreen->ConstrainCursorHarder(pDev, pScreen, mode, x, y);
+
     if (pPointer->x == *x && pPointer->y == *y && 
             pPointer->pScreen == pScreen) 
         return;
-- 
1.7.4



More information about the xorg-devel mailing list