Bug 459973 - Touch mode on convertible laptop gets activated even when there is an USB keyboard & mouse attached
Summary: Touch mode on convertible laptop gets activated even when there is an USB key...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.25.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-04 14:37 UTC by phrxmd
Modified: 2025-03-05 16:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description phrxmd 2022-10-04 14:37:11 UTC
SUMMARY
I use a Thinkpad X1 Yoga, which is a convertible laptop. I often use it in a monitor stand, where I flip the keyboard to the back, hang the notebook next to my monitor vertically and use it as a second screen. I have an USB keyboard and mouse attached to the notebook through a Thunderbolt dock.

Whenever I flip the keyboard to the back, Touch Mode gets enabled. That is very useful when using the laptop as a tablet, but not at my desktop where I have an USB keyboard and mouse attached at all times.

STEPS TO REPRODUCE
1. Set Touch Mode to "Automatically enabled" in System settings
2. Attach a USB keyboard and mouse
3. Flip the convertible laptop screen over

OBSERVED RESULT
The laptop's built in keyboard is disabled (as expected), but Touch Mode is enabled as well.

EXPECTED RESULT
Touch Mode should be enabled only when there is no keyboard and mouse at all.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220929
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.8-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8550U CPU @ 1.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: LENOVO
Product Name: 20LDCTO1WW
System Version: ThinkPad X1 Yoga 3rd
Comment 1 Nate Graham 2022-10-10 00:06:01 UTC
Yeah this is a legitimate use case and we should probably handle it better. If there are explicitly connected external input devices, it's a good sign that the user is using it like that, rather than as a handheld tablet.
Comment 2 wincak 2024-03-10 19:48:40 UTC
I have the same problem on Dell 7210 2-in-1 tablet. Disconnecting the tablet's main keyboard switches the device to Touch mode even if an external keyboard and mouse are connected. Also there does not seem to be an easy way to turn the Touch mode on and off manually except for directly in the system settings.

I'm using a keyboard and a mouse that share a wireless USB adapter.

Operating System: Kubuntu 23.10
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.0-25-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-10610U CPU @ 1.80GHz
Memory: 15,3 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Manufacturer: Dell Inc.
Product Name: Latitude 7210 2-in-1
Comment 3 Zamundaaa 2025-02-10 17:32:57 UTC
Sorry, we can't really do anything about this. Detecting if an input device is external should be doable, but detecting if it's a real keyboard is pretty much completely impossible. Too many things that aren't keyboards or mice claim to be either one or both :(
Comment 4 wincak 2025-03-01 21:34:50 UTC
A related problem has been recently discussed in another bug:
https://bugs.kde.org/show_bug.cgi?id=500025

It seems that the current algorithm KWin uses for automatic switching could be improved.

To block switching to touch mode when an external keyboard/mouse is connected is possible. Just make a list of input devices to ignore. If any other input device presenting itself as keyboard/mouse is detected, do not switch to touch mode.
I wrote a proof of concept program: https://gitlab.com/wincak/tablet-switch
Comment 5 Zamundaaa 2025-03-05 16:08:25 UTC
Everyone specifying a list of devices to exclude is technically possible, but not really practical.
If you find some way to automatically detect at least the majority of devices somehow, feel free to reopen this and/or make a MR for KWin though.