summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-07-31 16:09:38 +1000
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2012-08-19 08:48:09 -0700
commitf0823a057e4c80dbb18c16f066ad36e6459fcc85 (patch)
treece2db7e2bb0ead55ed341ef6c5ffd1ff544ee404
parent1f8a958a12c1c7c684051e5679420fe3a02ce307 (diff)
dix: make sure the mask is set for emulated scroll events (#52508)
If a device has smooth scrolling axes, but submits scroll button events, we convert those to motion events and update the valuators. For legacy button events, the valuator mask is likely unset though, causing add_to_scroll_valuator() to return early, leaving us with an empty mask. That again skipped the rest of the code and no events were generated. Fix it by making sure that the scroll valuator in the mask is at least initialized to 0. Broke evdev wheel emulation, introduced by 54476b5e4461ff523e935961affabcf0de12c556. X.Org Bug 52508 <http://bugs.freedesktop.org/show_bug.cgi?id=52508> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> (cherry picked from commit cb306a8f174bec9ded95191b91797f59250e6808)
-rw-r--r--dix/getevents.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index b78d5cec0..fade40c0f 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1601,6 +1601,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
if (adj != 0.0 && axis != -1) {
adj *= pDev->valuator->axes[axis].scroll.increment;
+ if (!valuator_mask_isset(&mask, axis))
+ valuator_mask_set(&mask, axis, 0);
add_to_scroll_valuator(pDev, &mask, axis, adj);
type = MotionNotify;
buttons = 0;