https://bugs.kde.org/show_bug.cgi?id=521120
Bug ID: 521120
Summary: KWin (Wayland) does not build TabletModeManager from a
libinput-reported SW_TABLET_MODE switch
Classification: Plasma
Product: kwin
Version First 6.6.4
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: virtual-keyboard
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
On a convertible laptop, KWin never builds its TabletModeManager from a
libinput-reported SW_TABLET_MODE switch, even though the kernel and libinput
both report that switch correctly. Because KWin has no tablet-mode state,
anything gated on tablet mode behaves as if the machine is permanently in one
mode. Concretely, the Plasma on-screen keyboard appears on every text-field
touch in laptop mode, which tablet detection is supposed to prevent.
Hardware / software:
- Framework Laptop 12 (convertible, 360-degree hinge, non-detachable keyboard)
- Fedora 43
- KDE Plasma 6.6.4, KWin on Wayland
- The tablet/laptop fold is exposed as a gpio-keys EV_SW SW_TABLET_MODE switch
(event13 here)
Steps to reproduce:
1. Plasma Wayland session, Virtual Keyboard set to "Plasma keyboard" in System
Settings.
2. Fold the screen past the tablet threshold, then unfold.
3. In laptop mode, tap any text input field.
Expected: the on-screen keyboard stays hidden in laptop mode and only appears
in tablet mode, because KWin knows the current tablet state from the switch.
Actual: the on-screen keyboard appears regardless of fold state; KWin defaults
to "always allow" because it has no tablet-mode state.
Diagnosis, layer by layer:
1. Kernel - OK. `sudo evtest /dev/input/event13` shows clean SW_TABLET_MODE 1
on fold / 0 on unfold.
2. libinput - OK. `sudo libinput debug-events` prints "SWITCH_TOGGLE ... switch
tablet-mode state 1" on fold and "state 0" on unfold. Everything below KWin
works.
3. KWin - fails here. `busctl --user tree org.kde.KWin | grep -i tablet`
returns nothing, before or after folding repeatedly. The
org.kde.KWin.TabletModeManager object is never created, so there is no tablet
state for the OSK (or anything else) to read, and tabletModeChanged never
fires.
For contrast, /VirtualKeyboard is present and its org.kde.kwin.VirtualKeyboard
"enabled"/"active" properties are writable, so the OSK plumbing is fine. It is
specifically the tablet-mode detection that is not wired up from the libinput
switch. This also makes the common workaround (monitor
org.kde.KWin.TabletModeManager tabletModeChanged) a no-op, because the object
never exists.
Userspace workaround (bypass, not a fix): a systemd --user service reads
SW_TABLET_MODE off the gpio-keys device directly and toggles
org.kde.kwin.VirtualKeyboard "enabled" true on fold / false on unfold (plus
"active" false to retract a visible keyboard), reading the live fold state on
startup via the EVIOCGSW ioctl. A udev rule (MODE="0664" matched on
ATTRS{name}=="gpio-keys") grants the user service read access, since a systemd
--user service does not inherit the input group. This restores correct behavior
but does not address the underlying KWin issue.
Expected fix: KWin should build TabletModeManager from the libinput-reported
tablet-mode switch so tablet mode works natively. Happy to test patches or
gather more diagnostics (busctl introspection, KWin debug logs, libinput
records) on this hardware.
--
You are receiving this mail because:
You are watching all bug changes.