Bug 62321

Summary: XInput2 XISlaveSwitch events don't give accurate valuator values
Product: xorg Reporter: Paul Vojta <vojta>
Component: Server/Input/CoreAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED WONTFIX QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: peter.hutterer, vojta
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Debugging output that exhibits the bug (as it exists currently)
none
Suggested patch
none
Sample patch (apply on top of previous patch) none

Description Paul Vojta 2013-03-14 04:21:25 UTC
In XI2.1, XISlaveSwitch events don't give accurate values for the vertical scroll valuator (and probably others).
To duplicate:  Have two pointing devices attached to the system.  At least one of them (call it Mouse A) should use the evdev device.  Start up an application that supports smooth scrolling.  In the application window, with Mouse A, scroll the wheel to make its valuator nonzero.  Start using the other pointing device, then resume using Mouse A.  When you first click the scroll wheel, it'll show a large scroll event.  This is because the XISlaveSwitch notification says that the valuator has value 0, but its value is whatever it was before starting to use the other mouse.
Comment 1 Peter Hutterer 2013-03-26 04:39:50 UTC
http://patchwork.freedesktop.org/patch/13387/
Comment 2 Peter Hutterer 2013-05-07 22:57:10 UTC
commit 23d1bc69f305edd5a6e2cfec3dfc84befda0881c
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Mar 14 11:07:57 2013 +1000

    dix: send the current axis value in DeviceChangedEvents (#62321)
Comment 3 Paul Vojta 2013-07-17 06:37:51 UTC
I find that the bug is not yet fixed (as of xorg-server-1.14.2).

I now get nonzero values in XISlaveSwitch events, and they correspond to
previous values of the valuator, but they don't reflect the situation in
those cases in which the valuator is cleared.

I attach some debugging output (with explanation), and a proposed patch
(which should be self-exlanatory).
Comment 4 Paul Vojta 2013-07-17 06:39:18 UTC
Created attachment 82526 [details]
Debugging output that exhibits the bug (as it exists currently)
Comment 5 Paul Vojta 2013-07-17 06:39:55 UTC
Created attachment 82527 [details] [review]
Suggested patch
Comment 6 Paul Vojta 2013-07-23 05:15:46 UTC
I've found that the problem also occurs with the values returned by XIQueryDevice.
To reproduce (again, with a synaptics touchpad (synaptics driver) and a standard mouse (evdev driver)):

1.  Before starting the application, scroll the synaptics driver up to get a large negative valuator value.
2.  Switch to the standard mouse, and then back to the touchpad.
3.  Start up the application.
4.  Scroll using the touchpad, and note that the window scrolls to the bottom at first.

Here is some debugging output (explanations same as before, but 8 is standard mouse, 10 is synaptics:

 IV 8 0
 IV 10 -6610
 dv 10 -6610 -> -4
 dv 10 -5 -> -12
 dv 10 -11.25 -> -14
 dv 10 -13.75 -> -19
 dv 10 -18.75 -> -21
Comment 7 Paul Vojta 2013-07-23 05:17:30 UTC
Created attachment 82855 [details] [review]
Sample patch (apply on top of previous patch)
Comment 8 Peter Hutterer 2016-11-28 04:39:55 UTC
This is a mass change of bugs. Bugs assigned to me that haven't been updated in the last 3 years are closed as WONTFIX, because, well, let's at least be honest about it.

Please do not re-open unless you have a really good reason to do so (e.g. you're fixing it yourself). If it hasn't been fixed in the last 3 years, it probably won't be fixed anytime soon either. Sorry.

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.