Bug 52508 - Evdev wheel emulation fails on device with scroll wheel
Summary: Evdev wheel emulation fails on device with scroll wheel
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium minor
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
: 52408 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-25 22:24 UTC by Ryan Pennucci
Modified: 2012-08-07 00:39 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Condensed log from 'xinput test-xi2' (7.70 KB, text/plain)
2012-07-30 07:29 UTC, Ryan Pennucci
no flags Details

Description Ryan Pennucci 2012-07-25 22:24:39 UTC
As reported at https://bugs.gentoo.org/show_bug.cgi?id=427632
Original report:
---
After upgrading x11-drivers/xf86-input-evdev to 2.7.0, emulateWheel stopped working in the vertical direction with a Kensington Expert Mouse (it's actually a trackball).
Horizontal scrolling still works, as does the actual mouse wheel on the device.
xev does not show any input at all when trying to scroll with the emulated wheel.

Installing 2.6.0 and restarting X fixes the problem.

Reproducible: Always

Steps to Reproduce:
1. Upgrade to x11-drivers/xf86-input-evdev
2. Restart X or reboot
3. Try to scroll using the emulated mouse wheel.
Actual Results:
No input events are sent to applications.

Expected Results:
Scrolling works as usual.
---

In my experience, bug shows with current releases of xf86-input-evdev (2.7 series) in combination with xserver 1.12.3 (1.12.2 and below are unaffected).  I've tested a handful of devices, and found that (vertical) wheel emulation only works where the device doesn't actually have a scroll wheel.  I don't have any way of testing devices with horizontal scroll wheels.

AFAICT, xserver expects devices with a wheel to report wheel motion on the wheel axis, rather than sending button presses.  Evdev does this in all of its code except wheel emulation, where it always sends button presses.  Mangling button presses into axis motion where an axis is present corrects the issue.
Comment 1 Peter Hutterer 2012-07-30 06:23:03 UTC
run xinput test-xi2 and scroll when you're above the main event window. What events do you see? please attach the output here, I suspect this is a client not handling the "emulated" flag correctly
Comment 2 Peter Hutterer 2012-07-30 06:30:42 UTC
*** Bug 52408 has been marked as a duplicate of this bug. ***
Comment 3 Ryan Pennucci 2012-07-30 07:15:59 UTC
I'll try to cut the output from xinput test-xi2 down to a reasonable size.  In the meantime, I'll summarize.

With scrollwheel:
The physical wheel produces ButtonPress/ButtonRelease pairs as expected, as well as RawButtonPress, RawMotion and Motion events.  Emulated horizontal scrolling produces ButtonPress/ButtonRelease events.  Emulated vertical scrolling only produces RawButtonRelease events.

Without:
Emulated scrolling in any direction produces ButtonPress/ButtonRelease pairs as expected.

The emulated flag appears only on events generated by the physical scroll wheel.
Comment 4 Ryan Pennucci 2012-07-30 07:29:58 UTC
Created attachment 64936 [details]
Condensed log from 'xinput test-xi2'

Log omits pointer motion and keyboard events.  It's been cut down to 1 'click' of each direction on each physical or emulated scroll wheel.
Comment 5 Peter Hutterer 2012-07-31 05:47:14 UTC
server bug, regression introduced by 54476b5e4461ff523e935961affabcf0de12c556
Comment 6 Peter Hutterer 2012-08-06 06:23:00 UTC
http://patchwork.freedesktop.org/patch/11535/
Comment 7 Peter Hutterer 2012-08-07 00:39:02 UTC
commit cb306a8f174bec9ded95191b91797f59250e6808
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 31 16:09:38 2012 +1000

    dix: make sure the mask is set for emulated scroll events (#52508)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.