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

            Bug ID: 511186
           Summary: Phantom base key input after Ctrl shortcuts when
                    switching windows (Wayland only)
    Classification: Plasma
           Product: kwin
      Version First 6.4.0
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: wayland-generic
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

**Summary:**
After pressing a Ctrl-based shortcut (e.g., Ctrl+C, Ctrl+V, Ctrl+S) in any
application under Fedora KDE Plasma Wayland, if I switch focus to another
window and click to place the caret, a **single phantom character**
corresponding to the shortcut’s base key (`c`, `v`, `s`) is immediately
inserted.

- It's not continuous (like `ccccccccccc`), it's just one; so I believe this is
not related to sticky keys or key repeat.
- This occurs **whenever I switch windows and click on the editor**, after
performing a Ctrl-based shortcut, whether immediately or after a few seconds.
- Happens only on Wayland, and **does not occur under X11** or on Windows, so
it is **not a keyboard hardware issue**.
- Any text already selected in the target window is replaced by the phantom
character.
- This started happening as soon as I migrated from Windows 11 to Fedora 42, a
few months ago, using the same hardware. I've been updating the system since,
but the issue is still happening.

**Steps to reproduce:**

1. Open any application (e.g., Firefox or Chrome) and select some text.
2. Press Ctrl+C to copy, and release.
3. Switch to a text editor (e.g., VSCode, Kate, LibreOffice Writer) by either:
3.1. `Alt + Tab`
3.2. Click to place the caret.
4. Observe that a `c` (or corresponding base key) is inserted automatically at
the caret, even though no key was pressed.

If using `Alt + Tab`, and text was already selected previously, that text will
be replaced by the `c` character.


**Expected behavior:**

Only the shortcut action should occur; no base key event should be sent to the
new window.

**Actual behavior:**

A single phantom key corresponding to the shortcut’s base key is inserted at
the caret.

**Frequency:**

Sporadic, but reproducible several times a day, when switching after Ctrl
shortcuts.

**System info:**

Fixed PC, with a keyboard, a mouse, 2 screens.

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Kernel Version: 6.17.4-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-8400 CPU @ 2.80GHz
Memory: 32 GiB of RAM (31.3 GiB usable)

**Possible cause:**

Wayland/KWin appears to **fail to suppress the base key after a modifier
release during window focus change**, leading to a phantom key being delivered
to the newly focused window.

**Possibly related issue:**

In some applications (especially LibreOffice Writer, rarely VS Code), after a
Ctrl-based shortcut and window switch, the caret can become a **dotted bar that
follows the mouse**, scrolling the document as the mouse moves.
This behavior appears connected to the phantom key issue, likely caused by the
same delayed or misinterpreted modifier/focus events in Wayland/KWin.

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

Reply via email to