lah7 / gtk3-classic

Patches to bring back a traditional experience for GTK+3
Other
339 stars 24 forks source link

"Fixes" patch: some non-Wacom drawing/graphics tablet styli incorrectly recognized as GDK_SOURCE_TOUCHSCREEN instead of GDK_SOURCE_PEN #89

Closed wyatt8740 closed 1 year ago

wyatt8740 commented 1 year ago

Some non-Wacom graphics/drawing tablet styli (like mine, a Huion H1060P) were being recognised as GDK_SOURCE_TOUCHSCREEN input sources, both with the digimend patches for non-Wacom devices and with the unmodified upstream wacom module.

This meant that when (for instance) one would hover over a menu in GTK3 programs, menu items being hovered over would not be highlighted until the actual "click" event, which is quite annoying.

I seem to remember (only off the top of my head) reading a bug report about this in GNOME's issue tracker a while back, and their response was that they would fix it for GTK4 but not touch it in GTK3.

Some digitizers (like the Huion H1060P) get enumerated by XInput by the wacom driver in X as being of type stylus, and the word stylus is appended to their names (in xinput).

GDK decides input source types by looking at device name strings when other techniques have failed to definitively provide an answer, but the only words GDK looks for to detect a stylus input device are wacom and pen.

The name of the Huion H1060P's stylus (for example) is HID 256c:006d stylus according to XInput, which matches neither the words wacom nor pen.

This patch simply adds a match for the word 'stylus' to fix this and correctly recognise more styli as being of type GDK_SOURCE_PEN.

I built this to test it using makepkg in my own custom build of pacman on a Debian Sid system, but I believe the little that I changed should not cause any issues on actual Arch. Please let me know if I messed anything up with the few lines that I added.

wyatt8740 commented 1 year ago

It should also be noted that GTK2 handles my tablet just fine from what I can tell. So this patch makes GTK3 behave more like GTK2.

wyatt8740 commented 1 year ago

Whoops, I forgot to add a checksum for that new patch file. I'll get on that.

lah7 commented 1 year ago

Thanks, the fix itself looks good to me! Although, the patch was missed from the series file, so it was not applied in the automated checks. ✔️ ❌

When looking through GTK3's repository, it would seem that it has been backported to GTK3:

As expected, the patch can't be added, because it's already there. 🙂

Apparently, Debian Sid is at 3.24.36, so I guess it's just a matter of building that version of the package with the rest of the classic patches.

wyatt8740 commented 1 year ago

Ah, glad that got fixed, then. I wasn't expecting it to at this point. Thank you.