[PATCH 1/2] track abs/rel mode changes in SwitchMode() instead of ignoring them

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


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

diff --git a/src/synaptics.c b/src/synaptics.c
index 4267c88..4d3e6d7 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2511,8 +2511,25 @@ CloseProc(InputInfoPtr pInfo)
 static int
 SwitchMode(ClientPtr client, DeviceIntPtr dev, int mode)
 {
+    LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
+    SynapticsPrivate *priv = (SynapticsPrivate *) (local->private);
+
     DBG(3, "SwitchMode called\n");
-    return (mode == Relative) ? Success : XI_BadMode;
+
+    switch (mode) {
+    case Absolute:
+        priv->absolute_events = TRUE;
+        break;
+
+    case Relative:
+        priv->absolute_events = FALSE;
+        break;
+
+    default:
+        return XI_BadMode;
+    }
+
+    return Success;
 }
 
 static Bool
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 9dc0a19..9ad8638 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -180,6 +180,7 @@ typedef struct _SynapticsPrivateRec
 
     struct CommData comm;
 
+    Bool absolute_events;               /* post absolute motion events instead of relative */
     SynapticsMoveHistRec move_hist[SYNAPTICS_MOVE_HISTORY]; /* movement history */
     int hist_index;			/* Last added entry in move_hist[] */
     int scroll_y;			/* last y-scroll position */
-- 
1.7.0.4



More information about the xorg-devel mailing list