Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.0
-
None
Description
In method xi2SetupDevice of qxcbconnection_xi2.cpp in the X11 platform plugin tablet pads are differentiated from their pen devices with an expansive if else statement by name (since X is as usual unhelpful in differentiating the two) around line 212.
The XP-Pen Artist 15.6 Pro tablet advertises via its device init string descriptors this composite name:
String 1: b'UGTABLET' String 2: b'15.6 inch PenDisplay'
Hence eventually through percolation of the uclogic driver the devices end up named:
UGTABLET 15.6 inch PenDisplay Pad UGTABLET 15.6 inch PenDisplay Pen
Both of these devices get caught up in the conditional for the name containing pen and thus both are treated as tablets. This makes the pad buttons behave undesirably since they get propagated as tabletEvents with a pointer of 0,0 and thus are always delivered to the topmost window widget since that puts them out of bounds of the application.
I'd want to assume a simple fix would be to shortcircuit this conditional with a check if the name contains "pad" and thus always treat those as not being tablets, but I'm willing to bet something out there is named Sparklepad or something that would break this in reverse. So maybe just match for the exact word "pad" bounded by whitespace / control characters? Or change the current conditional to only match the discrete word "pen"?
Alternatively I could rename this tablet somewhere else so as to not get caught in the device setup like this. Either in a udev / hwdb rule or somehow in X itself (cursory investigation makes me question if thats doable) if that would be a preferable solution. Of course I can't just rename it to XP-Pen Artist 15.6 Pro Pad & Pen for... obvious reasons. However this isn't a very permanent solution as several XP-Pen devices with similar nomenclature (Artist 13.3 Pro, Artist 12, Artist 22, etc) are in various states of upstream support that would also likely hit this issue.
Edit: Recalled that I did something just like this writing my KCM for tablet configuration. Here is how I determined tablets vs pads vs pens. In particular using XDeviceInfo::Type in determining tabletness might be be helpful.