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 741350 - Improve touchpad detection on libinput
Improve touchpad detection on libinput
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
1.20.x
Other Linux
: Normal enhancement
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks: 739397
 
 
Reported: 2014-12-10 17:25 UTC by Carlos Garnacho
Modified: 2014-12-11 10:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evdev: Lookup config to report touchpads as such (1.31 KB, patch)
2014-12-10 17:26 UTC, Carlos Garnacho
committed Details | Review
x11: Resort to device name matching for non-mt touchpads (1.12 KB, patch)
2014-12-10 17:26 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-12-10 17:25:02 UTC
I'm attaching a couple of patches that make touchpads recognized as such when libinput is used underneath. On the evdev backend, touchpad-specific settings can be poked, setting the right device type if the call returns an expected value.

On X11, the story is somewhat different though... if xf86-input-libinput is used, touchpads won't report being XIDependentTouch, so the second patch adds a fallback check on the device name. It should actually help identifying correctly semi-mt touchpads, even with the synaptics driver.
Comment 1 Carlos Garnacho 2014-12-10 17:26:47 UTC
Created attachment 292461 [details] [review]
evdev: Lookup config to report touchpads as such

Check a touchpad-only setting, and if it returns an expected value there,
the device must be a CLUTTER_DEVICE_TOUCHPAD.
Comment 2 Carlos Garnacho 2014-12-10 17:26:51 UTC
Created attachment 292462 [details] [review]
x11: Resort to device name matching for non-mt touchpads

If a touchpad is not multitouch, or does not report MT axes (eg. through
the libinput driver), resort to name matching before falling back to
CLUTTER_POINTER_DEVICE.
Comment 3 Emmanuele Bassi (:ebassi) 2014-12-10 17:43:55 UTC
Review of attachment 292461 [details] [review]:

::: clutter/evdev/clutter-input-device-evdev.c
@@ +190,3 @@
 _clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
 {
+  if (libinput_device_config_tap_get_finger_count (ldev) > 0)

do touchscreen devices return a finger count per tap equals to 0?
Comment 4 Emmanuele Bassi (:ebassi) 2014-12-10 17:44:33 UTC
Review of attachment 292462 [details] [review]:

sounds fair to me.
Comment 5 Carlos Garnacho 2014-12-10 19:21:40 UTC
(In reply to comment #3)
> +  if (libinput_device_config_tap_get_finger_count (ldev) > 0)
> 
> do touchscreen devices return a finger count per tap equals to 0?

This is basically a setting for the ABS_MT_* wrapping done exclusively on touchpads, touchscreens get the raw touch events, and no interpretation is performed on top. So for any other device that should be 0.

I could be slightly concerned in the future with the touch device in display-less wacom tablets (eg. bamboos), as these are basically touchpads to libinput, but I don't think we want to differ much in dealing with these either.
Comment 6 Emmanuele Bassi (:ebassi) 2014-12-10 19:49:11 UTC
Review of attachment 292461 [details] [review]:

okay, sounds fair to me; could you please leave a comment to that effect above the check?
Comment 7 Carlos Garnacho 2014-12-11 10:46:52 UTC
(In reply to comment #6)
> okay, sounds fair to me; could you please leave a comment to that effect above
> the check?

Sure :), pushing to 1.22 with the extra comment.
Comment 8 Carlos Garnacho 2014-12-11 10:49:30 UTC
Attachment 292461 [details] pushed as 1cabee8 - evdev: Lookup config to report touchpads as such
Attachment 292462 [details] pushed as a0e2ba6 - x11: Resort to device name matching for non-mt touchpads