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

            Bug ID: 526401
           Summary: Suspending with Fn+4 on Wayland can leave the "4" key
                    logically pressed in XWayland applications after
                    resume
    Classification: Plasma
           Product: plasmashell
      Version First 6.6.6
       Reported In:
          Platform: Gentoo Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Power management & brightness
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

On a ThinkPad E14 running Plasma 6.6.6 Wayland, suspending the system using the
Fn+4 sleep shortcut can leave the "4" key logically pressed in XWayland
applications after resume. After resume, XWayland applications such as FreeCAD
and KiCAD continuously receive autorepeated "4" input (444444...), even though
the key is no longer physically pressed. During the continuous repetition,
libinput debug-events shows no corresponding new keyboard events. The problem
is reproducible when suspending using Fn+4, but I could not reproduce it when
suspending using systemctl suspend.

I also could not reproduce the problem in a Plasma X11 session. Disabling
keyboard autorepeat prevents the visible symptom, but is not an acceptable
workaround.

STEPS TO REPRODUCE
1. Start a Plasma Wayland session.
2. Open an XWayland application with a text/input field (tested with FreeCAD
and KiCAD).
3. Suspend the laptop using Fn+4.
4. Resume the laptop.
5. Focus the XWayland application's input field.

OBSERVED RESULT
The application may continuously receive the 4 key through XWayland, as if the
key were still held down.
No corresponding repeated key events are visible in libinput debug-events.

EXPECTED RESULT
Keyboard state should be synchronized/reset across suspend/resume. Releasing
Fn+4 should not leave 4 logically pressed in XWayland.

ADDITIONAL INFORMATION
Suspending using systemctl suspend does not reproduce the problem.
Plasma X11 does not reproduce the problem in my testing.
The system uses s2idle.
PowerDevil was confirmed to request the suspension through
org.freedesktop.login1.Manager.Suspend() when Fn+4 is pressed.
Temporarily stopping plasma-powerdevil.service prevents Fn+4 from suspending
the system.
This suggests a timing/race condition involving the Fn+4 key release, suspend
initiation, and XWayland keyboard state synchronization.

SOFTWARE/OS
Gentoo Linux
KDE Plasma: 6.6.6
KDE Frameworks: 6.29.0
Qt: 6.11.2
Kernel: 7.2.7-gentoo-dist-bin
Graphics platform: Wayland
CPU/GPU: AMD Ryzen 7 7735U / Radeon Graphics
Laptop: Lenovo ThinkPad E14

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

Reply via email to