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.
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.
Yeah, it is pointing backwards.
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.
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.
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.
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.
Patchset ending here: https://lists.freedesktop.org/archives/wayland-devel/2017-September/034913.html
please give it a test if you can, thanks.
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.
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.
Do me a favour and open a new bug for the keyboard disabling so I don't end up confusing myself in this bug :)
Author: Peter Hutterer <email@example.com>
Date: Fri Sep 1 17:30:08 2017 +1000
touchpad: if a device has a tablet mode switch, disable the touchpad
Tested on the X1 Yoga and it works nicely.
For reference, I opened bug #102729 for the trackpoint and keyboard.