After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 557921 - [PATCH] Sound event support to metacity
[PATCH] Sound event support to metacity
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 315859 571066 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-10-26 02:15 UTC by Lennart Poettering
Modified: 2009-03-12 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (4.97 KB, patch)
2008-10-26 02:16 UTC, Lennart Poettering
none Details | Review
updated patch (5.61 KB, patch)
2009-02-10 05:05 UTC, Matthias Clasen
committed Details | Review

Description Lennart Poettering 2008-10-26 02:15:45 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
Comment 1 Lennart Poettering 2008-10-26 02:16:17 UTC
Created attachment 121368 [details] [review]
the patch
Comment 2 Thomas Thurman 2008-10-28 13:20:44 UTC
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?
Comment 3 A. Walton 2008-10-30 04:57:29 UTC
Go-go gadget audible desktop switch!

(that is, +1 from me. now to find a suitable "whoosh" sound...)
Comment 4 Lennart Poettering 2008-12-23 14:35:56 UTC
Ping?
Comment 5 Elijah Newren 2008-12-23 17:14:22 UTC
*** Bug 315859 has been marked as a duplicate of this bug. ***
Comment 6 Elijah Newren 2008-12-23 17:24:13 UTC
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.
Comment 7 Lennart Poettering 2008-12-23 18:48:26 UTC
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.
Comment 8 Patryk Zawadzki 2009-01-30 13:23:59 UTC
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.
Comment 9 Lennart Poettering 2009-02-04 22:57:17 UTC
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?
Comment 10 Matthias Clasen 2009-02-09 19:25:19 UTC
*** Bug 571066 has been marked as a duplicate of this bug. ***
Comment 11 Matthias Clasen 2009-02-09 19:32:52 UTC
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.
Comment 12 Matthias Clasen 2009-02-10 05:05:33 UTC
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 ?
Comment 13 Lennart Poettering 2009-02-10 15:53:04 UTC
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!
Comment 14 Lennart Poettering 2009-02-10 15:54:47 UTC
Oh, and who do I have to bribe to get Matthias' version of the patch merged?
Comment 15 Matthias Clasen 2009-02-12 00:53:57 UTC
        * 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.
Comment 16 Matt Kraai 2009-02-12 14:00:36 UTC
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.
Comment 17 Matthias Clasen 2009-02-12 23:15:48 UTC
My bad, I've corrected this oversight earlier today.
Comment 18 Matthias Clasen 2009-02-21 17:00:38 UTC
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.