GNOME Bugzilla – Bug 747436
Clutter should use the same heuristics as gtk+ to determine touchpads
Last modified: 2015-04-09 11:36:57 UTC
The current heuristics are broken under the libinput driver, which does not include the XITouchClass on touchpad devices. Arguably that's a bug, but it made it far enough that gtk+ has libinput specific code now. The same code should be used in clutter, otherwise mutter and gnome-control-center will disagree on the presence of a touchpad, and settings will not work.
Yeah, if you could not rely on the XITouchClass that'd be great, I was actually planning on removing this from the synaptics driver. It has never been used by anyone for real and it prevents another bug that's a hard-to-fix from ever being solved (https://bugs.freedesktop.org/show_bug.cgi?id=31636)
I guess Giovanni is basically talking about porting the GTK+ commit: commit 6f07d5e761f2c1d18825f73033ab7d095ea2c70d Author: Carlos Garnacho <carlosg@gnome.org> Date: Sun Feb 1 12:08:04 2015 +0100 x11: Detect libinput touchpads These aren't reported as XIDependentTouch devices, so make it poke a property that's specific to touchpads managed by the libinput driver. To the Clutter X11 backend. It shouldn't be too hard, let me see if I can get it going.
Created attachment 301192 [details] [review] x11: Improve touchpad detection heuristics We should use the same heuristics used by GDK in order to detect whether a device is a touchpad or not. Based on the similar code from Carlos Garnacho for GDK: https://git.gnome.org/browse/gtk+/commit/?id=6f07d5e7
Comment on attachment 301192 [details] [review] x11: Improve touchpad detection heuristics It looks alright to me :), I double checked and XFree falls back to free, so NULL is safely handled. We should be doing the same in GTK+ actually, althought the chance of leak is small.
(In reply to Carlos Garnacho from comment #4) > Comment on attachment 301192 [details] [review] [review] > x11: Improve touchpad detection heuristics > > It looks alright to me :) Thanks for the quick review. > I double checked and XFree falls back to free, so > NULL is safely handled. I'm not entirely sure that XIGetProperty() will nullify the out arguments in all cases, so I just wanted to make sure that the data is always either NULL or set to something.
Attachment 301192 [details] pushed as 83cd36e - x11: Improve touchpad detection heuristics