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 609585 - Merge libcanberra usage from Metacity
Merge libcanberra usage from Metacity
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-10 20:38 UTC by Owen Taylor
Modified: 2010-02-11 17:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use libcanberra to play system bell and workspace switch sounds (6.80 KB, patch)
2010-02-10 20:42 UTC, Owen Taylor
committed Details | Review
Now that we are using libcanberra, don't tell the X server to play the bell (1007 bytes, patch)
2010-02-10 20:45 UTC, Owen Taylor
committed Details | Review
Don't force CA_PROP_CANBERRA_ENABLE to 1. (1.09 KB, patch)
2010-02-10 20:45 UTC, Owen Taylor
committed Details | Review
bell: increase bell rate limit from 1/s to 1/100ms (1.31 KB, patch)
2010-02-10 20:45 UTC, Owen Taylor
committed Details | Review
tooltip: set window type hint for self-drawn tooltips to GDK_WINDOW_TYPE_HINT_TOOLTIP (1.04 KB, patch)
2010-02-10 20:45 UTC, Owen Taylor
committed Details | Review
sound: ask libcanberra to cache alert/desktop switch sounds (1.58 KB, patch)
2010-02-10 20:45 UTC, Owen Taylor
committed Details | Review
Make libcanberra support optional (5.03 KB, patch)
2010-02-11 15:33 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-02-10 20:38:40 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.
Comment 1 Owen Taylor 2010-02-10 20:42:11 UTC
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
Comment 2 Owen Taylor 2010-02-10 20:45:42 UTC
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
Comment 3 Owen Taylor 2010-02-10 20:45:45 UTC
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
Comment 4 Owen Taylor 2010-02-10 20:45:47 UTC
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
Comment 5 Owen Taylor 2010-02-10 20:45:50 UTC
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.
Comment 6 Owen Taylor 2010-02-10 20:45:53 UTC
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.
Comment 7 Tomas Frydrych 2010-02-11 08:33:48 UTC
(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.
Comment 8 Owen Taylor 2010-02-11 15:33:20 UTC
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 9 Tomas Frydrych 2010-02-11 15:51:02 UTC
Comment on attachment 153536 [details] [review]
Make libcanberra support optional

Thanks Owen, looks good.
Comment 10 Owen Taylor 2010-02-11 17:05:23 UTC
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