File mutter-bell.patch of Package mutter
Index: mutter-3.10.4/src/meta/prefs.h
===================================================================
--- mutter-3.10.4.orig/src/meta/prefs.h
+++ mutter-3.10.4/src/meta/prefs.h
@@ -93,6 +93,7 @@ typedef enum
META_PREF_WORKSPACE_NAMES,
META_PREF_VISUAL_BELL,
META_PREF_AUDIBLE_BELL,
+ META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER,
META_PREF_VISUAL_BELL_TYPE,
META_PREF_GNOME_ACCESSIBILITY,
META_PREF_GNOME_ANIMATIONS,
@@ -444,6 +445,7 @@ const char *meta_prefs_get_iso_next_grou
gboolean meta_prefs_get_visual_bell (void);
gboolean meta_prefs_bell_is_audible (void);
+gboolean meta_prefs_bell_force_through_server (void);
GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);
#endif
Index: mutter-3.10.4/src/core/prefs.c
===================================================================
--- mutter-3.10.4.orig/src/core/prefs.c
+++ mutter-3.10.4/src/core/prefs.c
@@ -95,6 +95,7 @@ static gboolean auto_raise_delay = 500;
static gboolean focus_change_on_pointer_rest = FALSE;
static gboolean bell_is_visible = FALSE;
static gboolean bell_is_audible = TRUE;
+static gboolean bell_force_through_server = FALSE;
static gboolean gnome_accessibility = FALSE;
static gboolean gnome_animations = TRUE;
static char *cursor_theme = NULL;
@@ -333,6 +334,13 @@ static MetaBoolPreference preferences_bo
&bell_is_audible, /* FIXME: change the name: it's confusing */
},
{
+ { "audible-bell-force-through-server",
+ SCHEMA_MUTTER,
+ META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER,
+ },
+ &bell_force_through_server,
+ },
+ {
{ KEY_GNOME_ACCESSIBILITY,
SCHEMA_INTERFACE,
META_PREF_GNOME_ACCESSIBILITY,
@@ -1788,6 +1796,9 @@ meta_preference_to_string (MetaPreferenc
case META_PREF_AUDIBLE_BELL:
return "AUDIBLE_BELL";
+ case META_PREF_AUDIBLE_BELL_FORCE_THROUGH_SERVER:
+ return "AUDIBLE_BELL_FORCE_THROUGH_SERVER";
+
case META_PREF_VISUAL_BELL_TYPE:
return "VISUAL_BELL_TYPE";
@@ -2079,6 +2090,12 @@ meta_prefs_bell_is_audible (void)
return bell_is_audible;
}
+gboolean
+meta_prefs_bell_force_through_server (void)
+{
+ return bell_force_through_server;
+}
+
GDesktopVisualBellType
meta_prefs_get_visual_bell_type (void)
{
Index: mutter-3.10.4/src/core/bell.c
===================================================================
--- mutter-3.10.4.orig/src/core/bell.c
+++ mutter-3.10.4/src/core/bell.c
@@ -309,6 +309,14 @@ meta_bell_notify (MetaDisplay *display,
if (meta_prefs_get_visual_bell ())
bell_visual_notify (display, xkb_ev);
+ if (meta_prefs_bell_force_through_server ())
+ {
+ XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent*) xkb_ev;
+ XkbForceBell (display->xdisplay,
+ xkb_bell_event->percent);
+ return;
+ }
+
#ifdef HAVE_LIBCANBERRA
if (meta_prefs_bell_is_audible ())
{
Index: mutter-3.10.4/src/org.gnome.mutter.gschema.xml.in
===================================================================
--- mutter-3.10.4.orig/src/org.gnome.mutter.gschema.xml.in
+++ mutter-3.10.4/src/org.gnome.mutter.gschema.xml.in
@@ -93,6 +93,16 @@
</_description>
</key>
+ <key name="audible-bell-force-through-server" type="b">
+ <default>false</default>
+ <_summary>Force the System Bell through the X server only.</_summary>
+ <_description>
+ Force the System Bell through the X server only for systems that
+ do not want to go through the sound card - for example that don't
+ have speakers.
+ </_description>
+ </key>
+
<child name="keybindings" schema="org.gnome.mutter.keybindings"/>
</schema>