Comment 46 for bug 486154

Revision history for this message
Robert Schroll (rschroll) wrote :

I think I've solved the issue of metacity grabbing audible system bell events. The attached patch contains my changes to metacity (specifically src/core/bell.c). Please give it a try and let me know if it works for you. If not, please let me know. I am a complete novice at dealing with .deb files, so it's very likely that I messed something up and produced an invalid patch.

This patch keeps metacity from grabbing system bell events. As a side effect it also solves the issue of metacity rate limiting the system bell events. It does not completely solve this bug. You still need to load (and possibly reload) the pcspkr module and turn the PC speaker on.

I developed this patch by reverting bits of bell.c back to the version from jaunty. Here's the reasons for the changes, identified by the old line number referenced in the diff:

1) Near line 52, I removed the #include of canberra-gtk.h, since we will no longer be using libcanberra to make bell noises.

2) Near line 281, a large chunk of code is excised. I believe all of this was for playing the bell.ogg sound through libcanberra, but I'm not entirely sure.

3) Also in that area, code was restored to keep meta_bell_set_audible() from being a no-op. The restores the ability of the gconf key /apps/metacity/general/audible_bell to turn the audible bell on and off.

4) Near line 355, the final argument of a call of XkbChangeEnabledControls() is changed. This is necessary to keep metacity from trapping the audible bell events!

As an aside, note that pulse audio's module-x11-bell *can* be used to play the bell.ogg sound in place of the PC speaker beep for system bell events. Since this is much easier to change and configure, I see no reason not to use this in place of the metacity/libcanberra solution for system bell events in future versions.