Bug 102408 - Disable touchpad in tablet mode (SW_TABLET_MODE)
Summary: Disable touchpad in tablet mode (SW_TABLET_MODE)
Status: VERIFIED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 101008
Blocks: 102729
  Show dependency treegraph
 
Reported: 2017-08-25 12:34 UTC by Benjamin Berg
Modified: 2017-09-14 21:49 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Recording of the switch (3.56 KB, text/plain)
2017-08-28 09:56 UTC, Benjamin Berg
Details

Description Benjamin Berg 2017-08-25 12:34:22 UTC
Bug 101008 is probably a dependency here, but it seems sane to track separately.

On the X1 Yoga 2nd Gen. the touchpad is not being disabled when the device switches into tablet mode. My guess is that it would be sane to handle this in libinput in the same way that the touchpad is disabled when the lid is being closed.
Comment 1 Peter Hutterer 2017-08-27 21:05:16 UTC
Is the touchpad accessible in tablet mode? so far we only disable touchpads on laptops where it's not accessible to avoid ghost touches (i.e. to work around hardware issues), in the Yoga case afaict that cannot happen because it's merely pointing backwards, not being obscured by the lid.
Comment 2 Benjamin Berg 2017-08-28 07:42:43 UTC
Yeah, it is pointing backwards.
Comment 3 Benjamin Berg 2017-08-28 08:50:36 UTC
I just tried holding the device in tablet mode. On the side of the touchpad it is practically impossible to hold it in a way that doesn't trigger clicks and mouse movements.
Comment 4 Peter Hutterer 2017-08-28 08:58:55 UTC
ok, then let's disable it. what device has the actual switch on it, can you attach an evemu recording here? Bug 101008 is separate because we can handle SW_TABLET_MODE internally without exposing it as userspace API.
Comment 5 Benjamin Berg 2017-08-28 09:56:15 UTC
Created attachment 133834 [details]
Recording of the switch

So, the switch is only triggered really late, i.e. when fully opened. I noticed that the keyboard is turned off much earlier (when opened more than 180°) but there is no event fired for that.

If I manage to re-install a windows on it, then I will report what they do with regard to the touchpad. I think that ideally we would turn it off already at the same time as the keyboard.
Comment 6 Benjamin Berg 2017-08-28 12:24:56 UTC
So, Windows 10 prompts me whether I want to switch into tablet mode as soon as I open the laptop slightly more than 180°. With the correct touchpad driver installed the touchpad is turned off automatically at that point (whether I enter "tablet mode" or not).

So my guess is we also have a separate kernel issue which means that the tablet mode is triggered too late on this machine.
Comment 7 Peter Hutterer 2017-09-05 03:13:04 UTC
https://github.com/whot/libinput/tree/wip/sw-tablet-mode

Patchset ending here: https://lists.freedesktop.org/archives/wayland-devel/2017-September/034913.html

please give it a test if you can, thanks.
Comment 8 Davide Depau 2017-09-07 09:02:57 UTC
I'd like to mention that in some Lenovo Yoga laptops, keyboard and trackpoint should be disabled too when switching to tablet mode.

My laptop, for instance, (a Lenovo ThinkPad X1 Yoga 1st) disables keyboard (the keys are physically blocked when the laptop is at an angle > 180°), but touchpad and trackpoint are still functional.

However, my friends laptop (some Lenovo non-ThinkPad Yoga) does not physically block anything, so when using it on some non-flat surface (like legs) you get keypresses.

> So, Windows 10 prompts me whether I want to switch into tablet mode as soon
> as I open the laptop slightly more than 180°. With the correct touchpad driver
> installed the touchpad is turned off automatically at that point (whether
> enter "tablet mode" or not).

So does mine. However, on my laptop, by listening to the acpid socket on Linux, I noticed that no event is actually triggered when the angle changes around 180°, aside from the backlight brightness change (my laptop automatically turns off backlight when the keys are blocked, and turns it back on afterwards).
Tablet mode is only triggered when it gets close to ~345°. I don't know what actually happens under the hood on Windows, but if we have some way to detect this too  checking for keyboard backlight change doesn't seem good to me -, it should probably be exposed somehow.
Comment 9 Benjamin Berg 2017-09-07 09:50:59 UTC
The fact that the keyboard also needs to be disabled is good to know.

We are currently tracking the kernel issues at https://bugzilla.redhat.com/show_bug.cgi?id=1486361. That said, it looks promising that there will be a fix will be available soon for different Lenovo convertibles.
Comment 10 Peter Hutterer 2017-09-07 23:12:39 UTC
Do me a favour and open a new bug for the keyboard disabling so I don't end up confusing myself in this bug :)
Comment 11 Peter Hutterer 2017-09-10 23:40:08 UTC
commit 986604fd9d86e92a2f04499ca23970f440201349
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Sep 1 17:30:08 2017 +1000

    touchpad: if a device has a tablet mode switch, disable the touchpad
Comment 12 Benjamin Berg 2017-09-14 12:36:18 UTC
Tested on the X1 Yoga and it works nicely.

For reference, I opened bug #102729 for the trackpoint and keyboard.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.