diff options
author | Joe Shaw <joe@joeshaw.org> | 2010-10-08 15:20:41 -0400 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-14 15:00:56 +1000 |
commit | 0b28a4c046a30ccb83278ea0aa59541fad89092c (patch) | |
tree | fe48f52af71ba845bc0c7250c24d4474164807ab | |
parent | a36976e7c9b1d408751a35caceef4fb64b6d7a1d (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.c | 19 | ||||
-rw-r--r-- | 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 */ |