summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvind Samptur <arvind.samptur@wipro.com>2005-01-26 08:43:38 +0000
committerArvind Samptur <arvind@src.gnome.org>2005-01-26 08:43:38 +0000
commitcf102c12f49c8b0d46bab252f453e83de9e70e5c (patch)
treec22ac59efb069bfc5fab29595ff4385017ccc4f0
parentebaa77c31229162fdf64a2196ad49dc35b1e6494 (diff)
downloadmetacity-cf102c12f49c8b0d46bab252f453e83de9e70e5c.tar.gz
Don't wireframe when accessibility is on, it apparently causes a desktop
2005-01-26 Arvind Samptur <arvind.samptur@wipro.com> Don't wireframe when accessibility is on, it apparently causes a desktop wide freeze. * src/prefs.[ch] (meta_prefs_init) (change_notify) (update_gnome_accessibility) (meta_preference_to_string) (meta_prefs_get_gnome_accessibility) : Add code to monitor accessibility status. * src/display.c (meta_display_begin_grab_op): Check accessibility status before going ahead with wireframe. Fixes #159538
-rw-r--r--ChangeLog14
-rw-r--r--src/display.c2
-rw-r--r--src/metacity.schemas.in4
-rw-r--r--src/prefs.c55
-rw-r--r--src/prefs.h4
5 files changed, 76 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 62038712..823ddb86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2005-01-26 Arvind Samptur <arvind.samptur@wipro.com>
+
+ Don't wireframe when accessibility is on, it apparently
+ causes a desktop wide freeze.
+
+ * src/prefs.[ch] (meta_prefs_init) (change_notify)
+ (update_gnome_accessibility) (meta_preference_to_string)
+ (meta_prefs_get_gnome_accessibility) : Add code to monitor
+ accessibility status.
+
+ * src/display.c (meta_display_begin_grab_op): Check
+ accessibility status before going ahead with wireframe.
+ Fixes #159538
+
2005-01-25 Elijah Newren <newren@gmail.com>
* src/tabpopup.c: (meta_select_workspace_expose_event): ignore
diff --git a/src/display.c b/src/display.c
index 543073bd..444261d4 100644
--- a/src/display.c
+++ b/src/display.c
@@ -3221,7 +3221,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
display->grab_anchor_window_pos = display->grab_initial_window_pos;
display->grab_wireframe_active =
- meta_prefs_get_reduced_resources () &&
+ (meta_prefs_get_reduced_resources () && !meta_prefs_get_gnome_accessibility ()) &&
(meta_grab_op_is_resizing (display->grab_op) ||
meta_grab_op_is_moving (display->grab_op));
diff --git a/src/metacity.schemas.in b/src/metacity.schemas.in
index 3d1b7dd6..58f9d119 100644
--- a/src/metacity.schemas.in
+++ b/src/metacity.schemas.in
@@ -271,7 +271,9 @@
avoiding animations, or other means. This is a significant
reduction in usability for many users, but may allow
legacy applications and terminal servers to function
- when they would otherwise be impractical.
+ when they would otherwise be impractical. However, the wireframe
+ feature is disabled when accessibility is on to avoid weird desktop
+ breakages
</long>
</locale>
</schema>
diff --git a/src/prefs.c b/src/prefs.c
index aa88f37b..4f06e790 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -52,6 +52,7 @@
#define KEY_DISABLE_WORKAROUNDS "/apps/metacity/general/disable_workarounds"
#define KEY_BUTTON_LAYOUT "/apps/metacity/general/button_layout"
#define KEY_REDUCED_RESOURCES "/apps/metacity/general/reduced_resources"
+#define KEY_GNOME_ACCESSIBILITY "/desktop/gnome/interface/accessibility"
#define KEY_COMMAND_PREFIX "/apps/metacity/keybinding_commands/command_"
@@ -88,6 +89,7 @@ static gboolean auto_raise_delay = 500;
static gboolean provide_visual_bell = TRUE;
static gboolean bell_is_audible = TRUE;
static gboolean reduced_resources = FALSE;
+static gboolean gnome_accessibility = FALSE;
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_INVALID;
static MetaButtonLayout button_layout = {
@@ -139,6 +141,7 @@ static gboolean update_terminal_command (const char *value);
static gboolean update_workspace_name (const char *name,
const char *value);
static gboolean update_reduced_resources (gboolean value);
+static gboolean update_gnome_accessibility (gboolean value);
static void change_notify (GConfClient *client,
guint cnxn_id,
@@ -315,6 +318,11 @@ meta_prefs_init (void)
&err);
cleanup_error (&err);
+ gconf_client_add_dir (default_client, KEY_GNOME_ACCESSIBILITY,
+ GCONF_CLIENT_PRELOAD_RECURSIVE,
+ &err);
+ cleanup_error (&err);
+
str_val = gconf_client_get_string (default_client, KEY_MOUSE_BUTTON_MODS,
&err);
cleanup_error (&err);
@@ -412,6 +420,12 @@ meta_prefs_init (void)
cleanup_error (&err);
update_terminal_command (str_val);
g_free (str_val);
+
+ bool_val = gconf_client_get_bool (default_client, KEY_GNOME_ACCESSIBILITY,
+ &err);
+
+ cleanup_error (&err);
+ update_gnome_accessibility (bool_val);
#endif /* HAVE_GCONF */
/* Load keybindings prefs */
@@ -434,6 +448,12 @@ meta_prefs_init (void)
NULL,
NULL,
&err);
+ gconf_client_notify_add (default_client, KEY_GNOME_ACCESSIBILITY,
+ change_notify,
+ NULL,
+ NULL,
+ &err);
+
cleanup_error (&err);
#endif /* HAVE_GCONF */
}
@@ -810,6 +830,22 @@ change_notify (GConfClient *client,
if (update_reduced_resources (b))
queue_changed (META_PREF_REDUCED_RESOURCES);
}
+ else if (strcmp (key, KEY_GNOME_ACCESSIBILITY) == 0)
+ {
+ gboolean b;
+
+ if (value && value->type != GCONF_VALUE_BOOL)
+ {
+ meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
+ KEY_GNOME_ACCESSIBILITY);
+ goto out;
+ }
+
+ b = value ? gconf_value_get_bool (value) : gnome_accessibility;
+
+ if (update_gnome_accessibility (b))
+ queue_changed (META_PREF_GNOME_ACCESSIBILITY);
+ }
else
{
meta_topic (META_DEBUG_PREFS, "Key %s doesn't mean anything to Metacity\n",
@@ -1326,6 +1362,16 @@ update_reduced_resources (gboolean value)
return old != reduced_resources;
}
+
+static gboolean
+update_gnome_accessibility (gboolean value)
+{
+ gboolean old = gnome_accessibility;
+
+ gnome_accessibility = value;
+
+ return old != gnome_accessibility;
+}
#endif /* HAVE_GCONF */
#ifdef WITH_VERBOSE_MODE
@@ -1399,6 +1445,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_REDUCED_RESOURCES:
return "REDUCED_RESOURCES";
break;
+ case META_PREF_GNOME_ACCESSIBILITY:
+ return "GNOME_ACCESSIBILTY";
+ break;
}
return "(unknown)";
@@ -2112,6 +2161,12 @@ meta_prefs_get_reduced_resources (void)
return reduced_resources;
}
+gboolean
+meta_prefs_get_gnome_accessibility ()
+{
+ return gnome_accessibility;
+}
+
MetaKeyBindingAction
meta_prefs_get_keybinding_action (const char *name)
{
diff --git a/src/prefs.h b/src/prefs.h
index 8da00da5..b0d38994 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -47,7 +47,8 @@ typedef enum
META_PREF_VISUAL_BELL,
META_PREF_AUDIBLE_BELL,
META_PREF_VISUAL_BELL_TYPE,
- META_PREF_REDUCED_RESOURCES
+ META_PREF_REDUCED_RESOURCES,
+ META_PREF_GNOME_ACCESSIBILITY
} MetaPreference;
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -72,6 +73,7 @@ gboolean meta_prefs_get_disable_workarounds (void);
gboolean meta_prefs_get_auto_raise (void);
int meta_prefs_get_auto_raise_delay (void);
gboolean meta_prefs_get_reduced_resources (void);
+gboolean meta_prefs_get_gnome_accessibility (void);
const char* meta_prefs_get_command (int i);