GNOME Bugzilla – Bug 371930
Xinput events incorrectly translated
Last modified: 2018-05-02 14:22:12 UTC
I've been told that XInput spec allows the maximum value for x/y axis to be 0 (or -1, depends on implementation I suppose) meaning bounded to screen size. In the current implementation 0 leads to division by zero and -1 gives totally bogus coordinates.
Created attachment 76143 [details] [review] proposed patch
I haven't been able to find this in the XInput spec. All I could find is that min/max are 0 if the device is in relative mode. Can you point me to that information in the spec ?
You're right, it is not (explicitly) said in the current spec. Daniel Stone said he could amend the spec for XInput 1.4, but take this with grain of salt. As I recall XInput does not have any event to notify clients the axis range has changed, say as a result of screen size change, so the special value of 0 or -1 works nicely as a special case for x/y axis.
Hi, This is indeed true: I thought the spec said this, but either I misread, or I can't find it anymore. But, given there's no way to notify you of min_val/max_val changes, this seems to be basically the only sensible route. Since I need to update the spec for general extended device usage anyway for 1.4, I can just clarify this at the same time ...
Reopening based on comment #4, it probably doesn't hurt to apply thus patch and be ahead of the spec :)
Hm, on second look I wonder if the patch is correct for WINDOW mode. Shouldn't it set "device_width" and "device_height" to the window's width and hight then?
(In reply to comment #4) > This is indeed true: I thought the spec said this, but either I misread, or I > can't find it anymore. But, given there's no way to notify you of > min_val/max_val changes, this seems to be basically the only sensible route. > Since I need to update the spec for general extended device usage anyway for > 1.4, I can just clarify this at the same time ... Daniel, can you please post the actual text updates you have in mind for the spec? it's not clear to me atm what changes you're envisioning exactly and how they interact with the different SCREEN/WINDOW/RELATIVE input modes - and we need to know that to fix this bug.
Daniel, can you please resopond to comment #7? We'd like to get this fixed properly in GDK.
What's the status here? Daniel, any chance you're giving this another shot? It would be a shame to leave this rusting here :)
Hm. This bug is set to NEEDINFO for quite some time now :-\ Could anybody either update patch 76143 or reject it?
IMHO it makes sense to wait for XI2 support at this point...
As suggested in comment #11, I've set xi2 branch integration bug as a blocker for this bug
Still valid in GTK+ 2.20
moving xinput bugs to gdkdevice
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/269.