summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Shaw <joe@joeshaw.org>2010-10-08 15:20:41 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2010-10-14 15:00:56 +1000
commit0b28a4c046a30ccb83278ea0aa59541fad89092c (patch)
treefe48f52af71ba845bc0c7250c24d4474164807ab
parenta36976e7c9b1d408751a35caceef4fb64b6d7a1d (diff)
track abs/rel mode changes in SwitchMode() instead of ignoring them
Signed-off-by: Joe Shaw <joe@joeshaw.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c19
-rw-r--r--src/synapticsstr.h1
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 */