Bug 381887 - KWin should replace system bells initiated by GTK programs with the standard alert sound
Summary: KWin should replace system bells initiated by GTK programs with the standard ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compatibility (other bugs)
Version First Reported In: 5.9.4
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 379295 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-01 22:46 UTC by Nate Graham
Modified: 2024-05-24 00:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2017-07-01 22:46:32 UTC
GTK emits system error bells to play an alert sound. By themselves, these are extremely unpleasant. So several years ago, GNOME 2.0's window manager metacity was changed to capture system bell events and translate them to a more pleasant sound [1]. This is well and good for GNOME, but KWin does not do the same thing, so GTK programs run from within a KDE Plasma environment *do* emit harsh, unpleasant system bell noises instead of something nicer like /usr/share/sounds/KDE-Sys-App-Error.ogg.

Absent KWin performing this translation, there are only bad options:
1. Live with the unpleasant noises, which cause user frustration and hatred [2].
2. Turn off the error bells throughout all of GTK by setting "gtk-error-bell = 0" in /etc/gtk-3.0/settings.ini, which prevents any alert sounds from playing at all. And regardless, this would be a distro change, not something KDE could enforce.
3. Turn off the PC speaker systemwide by adding "blacklist pcspkr" in /etc/modprobe.d/blacklist.conf. This is actually what Ubuntu does. This silences GTK programs as well as any potentially legitimate uses of the ancient PC speaker, and as with #2, KDE can't enforce this.




[1] For more information see these bugs for background:
https://bugzilla.gnome.org/show_bug.cgi?id=607906
https://bugs.launchpad.net/ubuntu/+source/module-init-tools/+bug/77010
https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/486154


[2] See some of the comments in https://bugs.launchpad.net/ubuntu/+source/module-init-tools/+bug/77010):

"No longer get the beep that just about gets people evicted from their apartment for blasting it at 3AM, or blows out someones ear drums while relaxing to some music with headphones."

"I would go so far as to say that we NEVER want to play the system beep during the course of a normal graphical session; sometimes it is so loud, users look as if they had received an electric shock"

"It was especially antagonizing when I was playing Solitaire as my last act before heading to bed, using the rote click-click-click to stupefy my attention and relax; except that clicking an already clicked card caused this loud shrieking bleep, which rather defeated the purpose of the game for me."
Comment 1 Nate Graham 2017-07-01 22:51:22 UTC
*** Bug 379295 has been marked as a duplicate of this bug. ***
Comment 2 Martin Flöser 2017-07-02 06:42:22 UTC
This is not a task of the window manager.
Comment 3 Nate Graham 2017-07-02 23:17:53 UTC
The GTK developers evidently think differently. And we both know that they're not going to change their mind. That leaves two possible outcomes:

1. KWin adapts, and GTK programs run under KWin play pleasant system sounds in all KDE environments and distros going forward.

2. KWin doesn't adapt, and GTK programs run under KWin periodically produce unpleasant beeps that don't respect the system volume level unless distros take matters into their own hands by either turning off all alert sounds in GTK programs, or muting the PC speaker globally.

It sounds like you're saying that #2 is acceptable for the foreseeable future. Is that correct?
Comment 4 Martin Flöser 2017-07-03 04:23:32 UTC
KWin won't implement this. Just because gnome added this to the window manager, doesn't mean we have to add it to the window manager. It could also be a dedicated app.

So again: it is not a task of the window manager.
Comment 5 Nate Graham 2017-07-03 12:02:07 UTC
All right.
Comment 6 Nicolas Fella 2024-05-19 14:00:28 UTC
Git commit 9e8f737280f5f5b910498e08734c9579e0df14b7 by Nicolas Fella.
Committed on 19/05/2024 at 13:52.
Pushed by nicolasfella into branch 'master'.

[kaccess] Always suppress audible X11 bell

X11 by default produces a horrible beep, which we allow to override with a custom sound.

The current code however only suppresses the default beep if 'Audible bell' is disabled,
not when a custom sound is enabled.

Always disable it so that we get full control over the sound
Related: bug 451546

M  +6    -10   kaccess/kaccess.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/9e8f737280f5f5b910498e08734c9579e0df14b7
Comment 7 Nicolas Fella 2024-05-19 14:00:44 UTC
Git commit a49c68d66240d9b389ac56d97d052a88a1e25a87 by Nicolas Fella.
Committed on 19/05/2024 at 13:52.
Pushed by nicolasfella into branch 'master'.

[kaccess] Play bell sound from the sound theme by default

Unless a custom sound is selected or bell sounds are disabled

M  +2    -2    kaccess/kaccess.cpp

https://invent.kde.org/plasma/plasma-desktop/-/commit/a49c68d66240d9b389ac56d97d052a88a1e25a87