After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747436 - Clutter should use the same heuristics as gtk+ to determine touchpads
Clutter should use the same heuristics as gtk+ to determine touchpads
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: x11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-04-07 04:22 UTC by Giovanni Campagna
Modified: 2015-04-09 11:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
x11: Improve touchpad detection heuristics (2.32 KB, patch)
2015-04-09 10:06 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Giovanni Campagna 2015-04-07 04:22:58 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.
Comment 1 Peter Hutterer 2015-04-08 23:57:53 UTC
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)
Comment 2 Emmanuele Bassi (:ebassi) 2015-04-09 09:52:46 UTC
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.
Comment 3 Emmanuele Bassi (:ebassi) 2015-04-09 10:06:10 UTC
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 4 Carlos Garnacho 2015-04-09 11:10:34 UTC
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.
Comment 5 Emmanuele Bassi (:ebassi) 2015-04-09 11:34:58 UTC
(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.
Comment 6 Emmanuele Bassi (:ebassi) 2015-04-09 11:36:53 UTC
Attachment 301192 [details] pushed as 83cd36e - x11: Improve touchpad detection heuristics