[metacity] prefs: Adapt to re-addition of a separate visual-bell option
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] prefs: Adapt to re-addition of a separate visual-bell option
- Date: Mon, 14 Nov 2011 14:44:58 +0000 (UTC)
commit c77ef5661c476aea94726b4c63cf28bd18bfd384
Author: Florian MÃllner <fmuellner gnome org>
Date: Mon Nov 14 15:22:16 2011 +0100
prefs: Adapt to re-addition of a separate visual-bell option
Commit a228546d3 merged the visual-bell/visual-bell-type options,
but the change turned out too disruptive for gnome-control-center /
gnome-shell, so gsettings-desktop-schemas commit a5819b2a4e9 re-added
the separate option.
src/core/bell.c | 8 +++-----
src/core/prefs.c | 15 +++++++++++++++
src/include/prefs.h | 1 +
3 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/src/core/bell.c b/src/core/bell.c
index a414519..4de91f9 100644
--- a/src/core/bell.c
+++ b/src/core/bell.c
@@ -271,9 +271,6 @@ bell_visual_notify (MetaDisplay *display,
case G_DESKTOP_VISUAL_BELL_FRAME_FLASH:
bell_flash_frame (display, xkb_ev); /* does nothing yet */
break;
- case G_DESKTOP_VISUAL_BELL_NONE:
- /* do nothing */
- break;
}
}
@@ -281,8 +278,9 @@ void
meta_bell_notify (MetaDisplay *display,
XkbAnyEvent *xkb_ev)
{
- /* flash something if appropriate */
- bell_visual_notify (display, xkb_ev);
+ /* flash something */
+ if (meta_prefs_get_visual_bell ())
+ bell_visual_notify (display, xkb_ev);
if (meta_prefs_bell_is_audible ())
{
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 1fcb567..62d9c29 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -80,6 +80,7 @@ static gboolean application_based = FALSE;
static gboolean disable_workarounds = FALSE;
static gboolean auto_raise = FALSE;
static gboolean auto_raise_delay = 500;
+static gboolean bell_is_visible = FALSE;
static gboolean bell_is_audible = TRUE;
static gboolean reduced_resources = FALSE;
static gboolean gnome_accessibility = FALSE;
@@ -289,6 +290,14 @@ static MetaBoolPreference preferences_bool[] =
FALSE,
},
{
+ { "visual-bell",
+ SCHEMA_GENERAL,
+ META_PREF_VISUAL_BELL,
+ },
+ &bell_is_visible, /* FIXME: change the name: it's confusing */
+ FALSE,
+ },
+ {
{ "audible-bell",
SCHEMA_GENERAL,
META_PREF_AUDIBLE_BELL,
@@ -1656,6 +1665,12 @@ meta_prefs_get_button_layout (MetaButtonLayout *button_layout_p)
}
gboolean
+meta_prefs_get_visual_bell (void)
+{
+ return bell_is_visible;
+}
+
+gboolean
meta_prefs_bell_is_audible (void)
{
return bell_is_audible;
diff --git a/src/include/prefs.h b/src/include/prefs.h
index c9f31ec..673cb36 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -201,6 +201,7 @@ void meta_prefs_get_window_binding (const char *name,
unsigned int *keysym,
MetaVirtualModifier *modifiers);
+gboolean meta_prefs_get_visual_bell (void);
gboolean meta_prefs_bell_is_audible (void);
GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]