GNOME Bugzilla – Bug 557921
[PATCH] Sound event support to metacity
Last modified: 2009-03-12 13:42:19 UTC
The attached patch adds basic event sound support to Metacity using libcanberra-gtk: - When a desktop is switched we generate desktop-switch-xxx sounds - When a the X11 bell is rung we generate bell-window-system sounds
Created attachment 121368 [details] [review] the patch
This is a pretty interesting idea. I wouldn't be averse to adding this, though I'd make it a configure option defaulting to on. Havoc, Elijah, any wisdom?
Go-go gadget audible desktop switch! (that is, +1 from me. now to find a suitable "whoosh" sound...)
Ping?
*** Bug 315859 has been marked as a duplicate of this bug. ***
Havoc said in bug 315859 that he thought this idea made sense. As far as configurability, is there some kind of system-wide "I don't like sound effects" key that we could just reuse? I'm one of those that tends to dislike system sound effects, but I'd also dislike having to turn them off for each program (control center, nautilus, gdm, metacity, etc., etc.). Anyway, despite that, I think it makes sense for this feature to go in and yeah, most people would probably want it on. Thanks, Lennart.
There's now a new gnome-sound-properties that on one hand allows you to configure each sound separately but also has a few global check boxes to disable all event sounds altogether at once, or to leave notification sounds enabled but input feedback sounds disabled. I think the default is to enable event sounds but disable input feedback sounds. (where input feed back sounds are those annoying sounds you get when you click buttons, pop up menus and so on). I don't think we should have per-application check boxes to disable event sounds.
Sounds are configurable and there is no requirement for any theme (including the default one) to include all the sounds so no additional switch should required.
Heya, the patch I prepared has now been sitting here for quite some time. Are any questions left open or is this good to be merged?
*** Bug 571066 has been marked as a duplicate of this bug. ***
As we've just discussed on irc, the patch needs a tiny update to get the window id out of the xkb bell notify and pass that on to libcanberra.
Created attachment 128352 [details] [review] updated patch Here is an updated patch. Changes: - set some more properties when playing the bell sound, such as CA_PROP_MEDIA_ROLE CA_PROP_WINDOW_NAME CA_PROP_WINDOW_X11_XID CA_PROP_APPLICATION_PROCESS_ID - override the values of CA_PROP_CANBERRA_ENABLE CA_PROP_APPLICATION_NAME that are set by ca_gtk_context_get(), since I think we want the system bell, even if event sounds are turned off, and we don't want all system bell sounds to come from "metacity". Lennart, does that look right to you ?
Looks good to me. Except the minor nitpick that setting CA_PROP_MEDIA_ROLE is redundant, since libcanberra will default to "event" anyway unless you overwrite it. Otherwise I am happy! Thanks for updating the patch!
Oh, and who do I have to bribe to get Matthias' version of the patch merged?
* configure.in: Require libcanberra-gtk * src/core/bell.c (meta_bell_notify): Play the alert sound from the sound theme instead of the dreaded system bell. * src/core/workspace.c (meta_workspace_activate_with_focus): Play a sound on workspace switch.
The change to configure.in wasn't applied, so Metacity fails to link because of undefined references to ca_proplist_create, ca_proplist_sets, etc.
My bad, I've corrected this oversight earlier today.
Had to do another tweak: * src/core/bell.c: Don't force CA_PROP_CANBERRA_ENABLE to 1. That was a misunderstanding on my part, and makes it impossible to get rid of the bell.