[PATCH 2/2] post absolute coordinate motion events if device mode is absolute

Joe Shaw joe at joeshaw.org
Fri Oct 8 12:20:42 PDT 2010


Signed-off-by: Joe Shaw <joe at joeshaw.org>
---
 src/synaptics.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/synaptics.c b/src/synaptics.c
index 4d3e6d7..a4445e9 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2423,8 +2423,12 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
 	ScaleCoordinates(priv, hw);
     }
 
-    timeleft = ComputeDeltas(priv, hw, edge, &dx, &dy, inside_active_area);
-    delay = MIN(delay, timeleft);
+    dx = dy = 0;
+
+    if (!priv->absolute_events) {
+      timeleft = ComputeDeltas(priv, hw, edge, &dx, &dy, inside_active_area);
+      delay = MIN(delay, timeleft);
+    }
 
 
     buttons = ((hw->left     ? 0x01 : 0) |
@@ -2449,8 +2453,11 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
     }
 
     /* Post events */
-    if (dx || dy)
-	xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
+    if (priv->absolute_events && inside_active_area) {
+        xf86PostMotionEvent(pInfo->dev, 1, 0, 2, hw->x, hw->y);
+    } else if (dx || dy) {
+        xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
+    }
 
     if (priv->mid_emu_state == MBE_LEFT_CLICK)
     {
-- 
1.7.0.4



More information about the xorg-devel mailing list