Summary: | Shortcut Key repeatedly triggers even when the key is pressed and released immediately (qt6, wayland) | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Ming Chuan <ming> |
Component: | Shortcuts and Canvas Input Settings | Assignee: | Tiar <tamtamy.tymona> |
Status: | ASSIGNED --- | ||
Severity: | normal | CC: | tamtamy.tymona |
Priority: | NOR | ||
Version First Reported In: | git master (please specify the git hash!) | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ming Chuan
2025-06-25 08:07:16 UTC
I added logging to https://github.com/qt/qtwayland/blob/6.9.0/src/client/qwaylandinputdevice.cpp , together with `WAYLAND_DEBUG=1` to observe the timestamp of wayland event processing, here is what's happening 1. User press ctrl+g on their keyboard 2. Wayland compositor send `wl_keyboard` key press event to krita 3. krita enters a busy state (probably busy calculating new group layer thumbnail?), stops reading any new wayland event 4. User releases ctrl+g key on their keyboard 5. The key repeat timer in `QWaylandInputDevice::Keyboard::Keyboard` got fired while krita is busy, a key repeat event is generated 6. krita leaves busy state, starts reading wayland events again, receives key release event and cancel the key repeat timer, but it's too late as the repeat event has been passed to application code for handling 7. qt.gui.shortcutmap groups the layer twice When I repro this, krita stayed in "busy state" for about 950ms Askmeaboutloom suggested turning off autorepeat on the actions we don't want to repeat, so I'm going to try that. Filed a ticket to QT [[QTBUG-139201] Key repeat handling in Qt Wayland vulnerable to race conditions when Wayland event loop stalls - Qt Bug Tracker](https://bugreports.qt.io/browse/QTBUG-139201) |