https://bugs.kde.org/show_bug.cgi?id=516580

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #6 from [email protected] ---
Created attachment 197869
  --> https://bugs.kde.org/attachment.cgi?id=197869&action=edit
Reproducer scripts + plasma-keyboard WAYLAND_DEBUG and dbus-monitor logs (8/24
run)

AI assistance was used to trace this and draft this comment.

Same bug here. Plasma/KWin/plasma-keyboard 6.7.5, Qt 6.11.2, Wayland (Bazzite
44), layouts us,ru, Alt+Shift (modifier-only).

To answer comment #5: no FCITX/IBus; plasma-keyboard is the only input method,
and setting Virtual Keyboard to "None" fixes it. It's not app-specific, because
KWin's own layout state reverts (layoutChanged fires with no shortcut or D-Bus
call behind it). I haven't tested a shortcut that includes a regular key.

Cause, from a WAYLAND_DEBUG trace of plasma-keyboard: the IM echoes each
wl_keyboard.modifiers back via zwp_input_method_context_v1.modifiers, including
the group, and KWin applies it (InputMethod::modifiers -> Xkb::updateModifiers,
src/inputmethod.cpp). The layout switch goes kglobalaccel -> D-Bus -> QAction,
so sometimes it lands before the IM's echo of the triggering Shift/Alt release.
That echo then carries the pre-switch group and reverts the layout:

  D-Bus     globalShortcutPressed, layoutChanged 0
  KWin->IM  wl_keyboard.modifiers (8, 0, 16, group 1)   <- pre-switch group
  IM->KWin  ctx.modifiers         (8, 0, 16, group 1)   <- applied, layout
reverted
  D-Bus     layoutChanged 1                             <- emitted only with
the next key press

That last line is why it looks like "the first key press switches it back".

Scripted repro (uinput Alt+Shift then "fg", 24 times, typed into a kdialog):
8/24 switches reverted. All 8 had the stale echo after the switch; none of the
16 clean rounds did. An earlier run gave 5/24 with the same pattern. Scripts
and logs from the 8/24 run are attached.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to