Bug 500916 - When holding an unavailable shortcut in an XWayland application, the warning Beep plays infinitely
Summary: When holding an unavailable shortcut in an XWayland application, the warning ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: xwayland (show other bugs)
Version: 6.3.2
Platform: Other Linux
: HI major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 501029 501524 501543 501789 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-03-01 18:03 UTC by Wilbur Jaywright
Modified: 2025-03-20 11:15 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wilbur Jaywright 2025-03-01 18:03:59 UTC
SUMMARY
I'm wary to try this in other applications, as it freezes Plasma, but if I'm in Python 3 IDLE (pretty sure an XWayland app), the following occurs. You know how if you hold backspace when there's no characters left to delete, or hold Ctrl + Z when there's no undo steps left, the beep sound will play on repeat until you let go? Well, it ain't stopping when I let go.

STEPS TO REPRODUCE
1. Install Python 3 IDLE and open a shell.
2. Hold backspace without typing anything.
3. After a couple seconds, release backspace.

OBSERVED RESULT
The sound plays repeatedly, doubling over itself loudly, and never stops. Plasma goes to like 0.01 FPS.

EXPECTED RESULT
The sound stops when you release the key.

SOFTWARE/OS VERSIONS
Windows: No.
macOS: No,
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Fedora 41 x86 64-bit
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
If you can get the IDLE window to close with Alt + F4 (takes a long time), the sound freeze does stop.
Comment 1 Nate Graham 2025-03-05 16:07:05 UTC
Yikes, I can reproduce this. The freeze eventually ends on its own for me, but it seems like it needs to play exactly as many beeps as the app sent before that happens. Which can be a lot of beeps.
Comment 2 Nate Graham 2025-03-05 17:27:59 UTC
*** Bug 501029 has been marked as a duplicate of this bug. ***
Comment 3 kde.granola631 2025-03-08 15:29:49 UTC
I encounter this as well on Plasma 6.3.2 and e.g. provoking a "bell" in Matlab (XWayland), however it totally freezes both machines I tested this  and either ssh'ing into them and killing the session or hard resetting is the only way to go.

As a workaround I found that disabling "Accessibility -> System Bell : Audible Bell" prevents the sound inferno.
Comment 4 Nate Graham 2025-03-15 20:14:55 UTC
*** Bug 501543 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2025-03-15 20:15:03 UTC
*** Bug 501524 has been marked as a duplicate of this bug. ***
Comment 7 Nicolas Fella 2025-03-17 13:40:27 UTC
Git commit 2e33bd0d2a9bca18b3b2f65a2aa0c61baa728081 by Nicolas Fella.
Committed on 17/03/2025 at 13:19.
Pushed by nicolasfella into branch 'master'.

plugins/systembell: Throttle audio bell

When too many bell requests are made simultaneously the resulting audio
playback can affect system performance, to the point where it completely
freezes.

Since playing too many audio bells at the same time is nonsensical anyway
limit ourselves to one every 100ms.

This interval is fairly arbitrary, but seems to work well enough in practice.
It still allows for two very fast keypresses to each trigger a distinctive bell.

M  +13   -0    src/plugins/systembell/systembell.cpp
M  +3    -0    src/plugins/systembell/systembell.h

https://invent.kde.org/plasma/kwin/-/commit/2e33bd0d2a9bca18b3b2f65a2aa0c61baa728081
Comment 8 Nicolas Fella 2025-03-17 14:19:21 UTC
Git commit 3350bbabd70970d542672d40945aa4a0eac4be2f by Nicolas Fella.
Committed on 17/03/2025 at 13:50.
Pushed by nicolasfella into branch 'Plasma/6.3'.

plugins/systembell: Throttle audio bell

When too many bell requests are made simultaneously the resulting audio
playback can affect system performance, to the point where it completely
freezes.

Since playing too many audio bells at the same time is nonsensical anyway
limit ourselves to one every 100ms.

This interval is fairly arbitrary, but seems to work well enough in practice.
It still allows for two very fast keypresses to each trigger a distinctive bell.


(cherry picked from commit 2e33bd0d2a9bca18b3b2f65a2aa0c61baa728081)

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +13   -0    src/plugins/systembell/systembell.cpp
M  +3    -0    src/plugins/systembell/systembell.h

https://invent.kde.org/plasma/kwin/-/commit/3350bbabd70970d542672d40945aa4a0eac4be2f
Comment 9 Nicolas Fella 2025-03-20 11:15:12 UTC
*** Bug 501789 has been marked as a duplicate of this bug. ***