[PATCH 02/42] dix: add an update argument to positionSprite

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 14 19:01:39 PST 2011


For future touch points, we need positionSprite to calculate the coordinates
but we don't want to actually change the cursor position for non-emulating
touches.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/getevents.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 57d8c17..3b7b626 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -808,7 +808,7 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
  * @param[out] screeny y coordinate in desktop coordinate system
  */
 static ScreenPtr
-positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask,
+positionSprite(DeviceIntPtr dev, Bool update, int mode, ValuatorMask *mask,
                double *devx, double *devy,
                double *screenx, double *screeny)
 {
@@ -839,6 +839,9 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask,
     *devx = x;
     *devy = y;
 
+    if (!update)
+        return scr;
+
     /* miPointerSetPosition takes care of crossing screens for us, as well as
      * clipping to the current screen. Coordinates returned are in desktop
      * coord system */
@@ -1251,7 +1254,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
     if ((flags & POINTER_NORAW) == 0)
         set_raw_valuators(raw, &mask, raw->valuators.data);
 
-    scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
+    scr = positionSprite(pDev, TRUE, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
                          &mask, &devx, &devy, &screenx, &screeny);
 
     /* screenx, screeny are in desktop coordinates,
-- 
1.7.7.1



More information about the xorg-devel mailing list