--- metacity-2.28.0/src/core/bell.c	2009-09-08 16:55:35.000000000 -0400
+++ metacity-mine/src/core/bell.c	2009-12-31 17:38:32.000000000 -0500
@@ -52,7 +52,6 @@
 #include "bell.h"
 #include "screen-private.h"
 #include "prefs.h"
-#include <canberra-gtk.h>
 
 /**
  * Flashes one entire screen.  This is done by making a window the size of the
@@ -281,51 +280,18 @@
   /* flash something */
   if (meta_prefs_get_visual_bell ()) 
     bell_visual_notify (display, xkb_ev);
-
-  if (meta_prefs_bell_is_audible ()) 
-    {
-      ca_proplist *p;
-      XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent*) xkb_ev;
-      MetaWindow *window;
-      int res;
-
-      ca_proplist_create (&p);
-      ca_proplist_sets (p, CA_PROP_EVENT_ID, "bell-window-system");
-      ca_proplist_sets (p, CA_PROP_EVENT_DESCRIPTION, _("Bell event"));
-
-      window = meta_display_lookup_x_window (display, xkb_bell_event->window);
-      if (!window && (display->focus_window) && (display->focus_window->frame))
-        window = display->focus_window;
-
-      if (window)
-        { 
-          ca_proplist_sets (p, CA_PROP_WINDOW_NAME, window->title);
-          ca_proplist_setf (p, CA_PROP_WINDOW_X11_XID, "%lu", (unsigned long)window->xwindow);
-          ca_proplist_sets (p, CA_PROP_APPLICATION_NAME, window->res_name);
-          ca_proplist_setf (p, CA_PROP_APPLICATION_PROCESS_ID, "%d", window->net_wm_pid);
-        }
-
-      /* First, we try to play a real sound ... */
-      res = ca_context_play_full (ca_gtk_context_get (), 1, p, NULL, NULL);
-
-      ca_proplist_destroy (p);
-
-      if (res != CA_SUCCESS && res != CA_ERROR_DISABLED)
-        {      
-          /* ...and in case that failed we use the classic X11 bell. */
-          XkbForceDeviceBell (display->xdisplay, 
-                              xkb_bell_event->device, 
-                              xkb_bell_event->bell_class, 
-                              xkb_bell_event->bell_id, 
-                              xkb_bell_event->percent);
-        }
-    }
 }
 #endif /* HAVE_XKB */
 
 void
 meta_bell_set_audible (MetaDisplay *display, gboolean audible)
 {
+#ifdef HAVE_XKB
+  XkbChangeEnabledControls (display->xdisplay,
+			    XkbUseCoreKbd,
+			    XkbAudibleBellMask,
+			    audible ? XkbAudibleBellMask : 0);
+#endif  
 }
 
 gboolean
@@ -355,7 +321,8 @@
       XkbChangeEnabledControls (display->xdisplay,
 				XkbUseCoreKbd,
 				XkbAudibleBellMask,
-                                0);
+				meta_prefs_bell_is_audible () 
+				? XkbAudibleBellMask : 0);
       if (visual_bell_auto_reset) {
 	XkbSetAutoResetControls (display->xdisplay,
 				 XkbAudibleBellMask,
