diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-01-15 14:01:02 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-01-20 10:48:36 +1000 |
commit | 7b0a65d989117d1b071101221ff1b97c1b4d1946 (patch) | |
tree | 55b3059d83d56d3da9703f3341caff420a742220 | |
parent | Restore wheel emulation for absolute devices (diff) | |
download | xf86-input-evdev-7b0a65d989117d1b071101221ff1b97c1b4d1946.tar.gz xf86-input-evdev-7b0a65d989117d1b071101221ff1b97c1b4d1946.tar.bz2 xf86-input-evdev-7b0a65d989117d1b071101221ff1b97c1b4d1946.zip |
Don't reset the other axis on wheel emulation scroll buildup
The idea was that of a direction lock: as we move vertically we should not
build up any horizontal scroll motion even if we move slightly diagonally.
The effect was though that the axis would be reset completely as soon as an
event from the other axis occured. With the default threshold of 10, if one in
ten events was a REL_X, we'd never get a wheel event.
Drop this code, it's not needed. By default wheel emulation doesn't do
horizontal scrolling, if a config snippet sets XAxisMapping the user wants
horizontal scrolling. And since we just add the value anyway, as long as the
user does a roughly vertical motion we won't get over the threshold anyway.
https://bugs.freedesktop.org/show_bug.cgi?id=93617
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/emuWheel.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/emuWheel.c b/src/emuWheel.c index f1d1990..c82c240 100644 --- a/src/emuWheel.c +++ b/src/emuWheel.c @@ -95,7 +95,7 @@ BOOL EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) { EvdevPtr pEvdev = (EvdevPtr)pInfo->private; - WheelAxisPtr pAxis = NULL, pOtherAxis = NULL; + WheelAxisPtr pAxis = NULL; int value = pEv->value; /* Has wheel emulation been configured to be enabled? */ @@ -130,13 +130,11 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) /* ABS_X has the same value as REL_X, so this case catches both */ case REL_X: pAxis = &(pEvdev->emulateWheel.X); - pOtherAxis = &(pEvdev->emulateWheel.Y); break; /* ABS_Y has the same value as REL_Y, so this case catches both */ case REL_Y: pAxis = &(pEvdev->emulateWheel.Y); - pOtherAxis = &(pEvdev->emulateWheel.X); break; default: @@ -144,15 +142,10 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) } /* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse - wheel. Reset the inertia of the other axis when a scroll event - was sent to avoid the buildup of erroneous scroll events if the - user doesn't move in a perfectly straight line. + wheel. */ if (pAxis) - { - if (EvdevWheelEmuInertia(pInfo, pAxis, value)) - pOtherAxis->traveled_distance = 0; - } + EvdevWheelEmuInertia(pInfo, pAxis, value); /* Eat motion events while emulateWheel button pressed. */ return TRUE; |