GNOME Bugzilla – Bug 609585
Merge libcanberra usage from Metacity
Last modified: 2010-02-11 17:05:42 UTC
Here's a set of patches from Metacity that enables using libcanberra to play themed: - System bell - Workspace switch sound I think the patches are fine - they've gotten quite a bit of testing in Metacity and look fine to me. The basic question here is whether a hard dependency on libcanberra is OK for Moblin or not. If not, we'll need to redo this to be be conditionally compiled.
Created attachment 153464 [details] [review] Use libcanberra to play system bell and workspace switch sounds Patch by Lennart Poettering * 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. https://bugzilla.gnome.org/show_bug.cgi?id=557921
Created attachment 153465 [details] [review] Now that we are using libcanberra, don't tell the X server to play the bell * src/core/bell.c (meta_bell_set_audible): Now that we are using libcanberra, don't tell the X server to play the system bell internally. svn path=/trunk/; revision=4141
Created attachment 153466 [details] [review] Don't force CA_PROP_CANBERRA_ENABLE to 1. * 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. svn path=/trunk/; revision=4165
Created attachment 153467 [details] [review] bell: increase bell rate limit from 1/s to 1/100ms Right now metacity issues only 1 bell event per second. This is feels buggy when triggering multiple alarm sounds in a terminal. This patch simple increases the limit to 1/100ms. 100ms is probably a good choice since the HIG recommends that all user reaction should happen within 100ms. With this applied pressing 'Left' in gnome-terminal feels much more responsive. https://bugzilla.redhat.com/show_bug.cgi?id=498608
Created attachment 153468 [details] [review] tooltip: set window type hint for self-drawn tooltips to GDK_WINDOW_TYPE_HINT_TOOLTIP libcanberra generates specific tooltip popup sounds and for that recognizes the tooltip windows by the GtkWindowTypeHint set for them. This trivial patch simply sets the hint for the self-drawn tooltips metacity uses.
Created attachment 153469 [details] [review] sound: ask libcanberra to cache alert/desktop switch sounds These sounds are good candidates for caching in the sound server, to save a bit of CPU and make reaction faster. Hence, tell libcanberra to cache them.
(In reply to comment #0) > The basic question here is whether a hard dependency on > libcanberra is OK for Moblin or not. If not, we'll need to redo this to be > be conditionally compiled. I would prefer to be able to disable this at configure time.
Created attachment 153536 [details] [review] Make libcanberra support optional Add a configure switch: --with-libcanberra=[yes/no/auto] (defaulting to auto); if libcanberra is not found or explicitly disabled, then the default system bell will be used for the bell sound and no switch workspace sound is played.
Comment on attachment 153536 [details] [review] Make libcanberra support optional Thanks Owen, looks good.
Attachment 153464 [details] pushed as 5aab9e8 - Use libcanberra to play system bell and workspace switch sounds Attachment 153465 [details] pushed as c51767e - Now that we are using libcanberra, don't tell the X server to play the bell Attachment 153466 [details] pushed as 709ef05 - Don't force CA_PROP_CANBERRA_ENABLE to 1. Attachment 153467 [details] pushed as 11addbe - bell: increase bell rate limit from 1/s to 1/100ms Attachment 153468 [details] pushed as b610b2e - tooltip: set window type hint for self-drawn tooltips to GDK_WINDOW_TYPE_HINT_TOOLTIP Attachment 153469 [details] pushed as 1253e6c - sound: ask libcanberra to cache alert/desktop switch sounds Attachment 153536 [details] pushed as 857c8aa - Make libcanberra support optional