summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-01-15 14:01:02 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-01-20 10:48:36 +1000
commit7b0a65d989117d1b071101221ff1b97c1b4d1946 (patch)
tree55b3059d83d56d3da9703f3341caff420a742220 /src
parentd24431a1863c49aa9edcabf535ffa64bfa87053c (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/emuWheel.c13
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;