GNOME Bugzilla – Bug 774699
[wintab, potential segfault]: list iteration regression causes odd-indexed devices to be ignored during lookup & e.g. present no pressure
Last modified: 2016-11-21 18:11:57 UTC
Commit 4ce6d1060104e7072eec347370999bfd3fe69dc0 introduces a list iteration bug whereby devices with alternate entries in the manager's wintab_devices list will be passed over during lookup.
This new code is probably a big source of more recent "wintab device does not have pressure" bugs for us, because it is used to find the Wintab device for a native windowing message from the tablet driver for each motion event. If the device has an odd zero-based position in the list, it will be skipped over even if the corresponding event had pressure.
(Unaffected: Wacom Intuos 5 M. Affected: Huion H610PRO. Could be ~50% of devices out there.)
More importantly, the wintab event handling code currently carries a potential for a segfault if the wintab_devices list has an even length and no even-indexed devices in the list "do" pressure.
This code is present in master and on the gtk-3-22 stable branch. It affects versions of GTK between 3.19.9 and 3.22.4 inclusive.
I will attach a tested patch against stable shortly.
Created attachment 340281 [details] [review]
Briefly tested patch against gtk-3-22. Fixes pressure for one of my broken tablets at least.
Also fix up the comparison for coding style.
Please could this be applied to the stable and master branches?
Correction^^: [...] if the wintab_devices list has an odd length and [...]
Comment on attachment 340281 [details] [review]
[[This comment is duplicated into the 3 active Wintab bugs, sorry for the spam]]
Okay, big testing rollup. Incorporating the following patches was *VERY* positive, getting rid of all inti-time crashes and almost all missing pressure. Tilt and eraser are back online and looking good for more advanced tablets.
* bug 774699 comment 1
* bug 774379 comment 29
* bug 774379 comment 20
* Sorry LRN, your patch from bug 774379 comment 26 didn't apply cleanly
onto the stable branch (gtk-3-22) alongside all my patches. I was not
able to test it.
* bug 774265 comment 12
I made a debug build and installation on MSYS2 of all the software needed, for both i686 and x86_64, and tested them all from their appropriate MSYS2 shell.
Arch Tablet model Drivers gtk3-demo mypaint-git
---- ------------- ------- --------- ------------
x86_64 Huion H610PRO 12.2.16 OK OK
i686 Huion H610PRO 12.2.16 OK OK
x86_64 Wacom Intuos 5 M (PTH-650) 6.3.18-5 OK +T +E OK +T +E
i686 Wacom Intuos 5 M (PTH-650) 6.3.18-5 OK +T +E OK +T +E
x86_64 Genius EasyPen i405X (GT-100007) 126.96.36.199* OK OK
i686 Genius EasyPen i405X (GT-100007) 188.8.131.52* NOEVENTS NOEVENTS
My system is AMD64, so it is possible that the Genius driver installers made a decision about what to install for me. It is possible we've seen this behaviour before in MyPaint-land, so the lone failure above isn't a worry for me right now.
NOEVENTS Device presents only as "System Aggregated Pointer", and does
not send events with pressure. Evidence of wintab32.dll
being loaded by wintab_init_check, though!
OK Device presents as something other than "System Aggregated Pointer",
and sends events with pressure.
+T Device also correctly presents tilt.
+E Device also presents the eraser end of the stylus as a named device.
* Drivers are branded "ioTablet", manufacturer "KYE",
but were downloaded from geniusnet.com as recommended.
This one is already accepted-commit_now, so I'm not nagging. Thanks for the review, carlosg.