summaryrefslogtreecommitdiff
path: root/src/prefs.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-10-12 06:25:38 +0000
committerHavoc Pennington <hp@src.gnome.org>2003-10-12 06:25:38 +0000
commite98fad3e62f9aa4d6c899f773b81687eeac40248 (patch)
tree69efe13e78cb669495d4b6ad8d6efe22f87631c7 /src/prefs.c
parent6628acb59c697d6317b87dddd44a26ecea698ba3 (diff)
downloadmetacity-e98fad3e62f9aa4d6c899f773b81687eeac40248.tar.gz
Merge reduced_resources mode patch from the branch. Offers wireframe and
2003-10-12 Havoc Pennington <hp@redhat.com> Merge reduced_resources mode patch from the branch. Offers wireframe and no-animations. * src/window.c (implement_showing): no animation if we are in reduced resources mode * src/prefs.c: add REDUCED_RESOURCES pref * src/window.c (meta_window_update_keyboard_resize): fix to modify grab_anchor_window_pos to grab_wireframe_rect if appropriate instead of window->rect * src/display.h (struct _MetaDisplay): add grab_start_serial used to avoid responding to events that occurred prior to the grab initialization. Still broken in various ways, specifically EnterNotify that occurred prior to XGrabPointer is processed as if it occurred after. * src/window.c (meta_window_update_keyboard_move): add this instead of meta_window_warp_pointer() crack * src/effects.c (meta_effects_update_wireframe): draw a kind of grid for the wireframe, instead of just a rectangle, like twm * src/screen.c (meta_screen_new): line width of 3 for the XOR gc "Reduced resources" mode based on wireframe patch from Erwann Chenede. Still pretty buggy. * src/keybindings.c (process_keyboard_move_grab) (process_keyboard_resize_grab): add gruesome wireframe hacks * src/display.c (meta_display_end_grab_op): end wireframe (meta_display_begin_grab_op): begin wireframe * src/effects.c (meta_effects_end_wireframe) (meta_effects_update_wireframe, meta_effects_begin_wireframe): routines to draw the wireframe stuff * src/window.c (window_should_be_showing): hide window when doing wireframe, commented out as it breaks grab * src/window.c (meta_window_refresh_resize_popup): handle wireframe * src/screen.c (meta_screen_new): create a screen->root_xor_gc for use in drawing wireframes * src/frames.c (meta_frames_push_delay_exposes): repaint everything before we delay
Diffstat (limited to 'src/prefs.c')
-rw-r--r--src/prefs.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/prefs.c b/src/prefs.c
index 9ed41bcd..81af51e3 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -51,6 +51,7 @@
#define KEY_APPLICATION_BASED "/apps/metacity/general/application_based"
#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_COMMAND_PREFIX "/apps/metacity/keybinding_commands/command_"
#define KEY_SCREEN_BINDINGS_PREFIX "/apps/metacity/global_keybindings"
@@ -83,6 +84,8 @@ static gboolean auto_raise = FALSE;
static gboolean auto_raise_delay = 500;
static gboolean provide_visual_bell = TRUE;
static gboolean bell_is_audible = TRUE;
+static gboolean reduced_resources = FALSE;
+
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_INVALID;
static MetaButtonLayout button_layout = {
{
@@ -129,6 +132,7 @@ static gboolean update_command (const char *name,
const char *value);
static gboolean update_workspace_name (const char *name,
const char *value);
+static gboolean update_reduced_resources (gboolean value);
static void change_notify (GConfClient *client,
guint cnxn_id,
@@ -372,7 +376,6 @@ meta_prefs_init (void)
cleanup_error (&err);
update_button_layout (str_val);
g_free (str_val);
-#endif /* HAVE_GCONF */
bool_val = gconf_client_get_bool (default_client, KEY_VISUAL_BELL,
&err);
@@ -388,6 +391,12 @@ meta_prefs_init (void)
update_visual_bell_type (str_val);
g_free (str_val);
+ bool_val = gconf_client_get_bool (default_client, KEY_REDUCED_RESOURCES,
+ &err);
+ cleanup_error (&err);
+ update_reduced_resources (bool_val);
+#endif /* HAVE_GCONF */
+
/* Load keybindings prefs */
init_bindings ();
@@ -733,6 +742,22 @@ change_notify (GConfClient *client,
if (update_visual_bell_type (str))
queue_changed (META_PREF_VISUAL_BELL_TYPE);
}
+ else if (strcmp (key, KEY_REDUCED_RESOURCES) == 0)
+ {
+ gboolean b;
+
+ if (value && value->type != GCONF_VALUE_BOOL)
+ {
+ meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
+ KEY_REDUCED_RESOURCES);
+ goto out;
+ }
+
+ b = value ? gconf_value_get_bool (value) : reduced_resources;
+
+ if (update_reduced_resources (b))
+ queue_changed (META_PREF_REDUCED_RESOURCES);
+ }
else
{
meta_topic (META_DEBUG_PREFS, "Key %s doesn't mean anything to Metacity\n",
@@ -1239,6 +1264,16 @@ update_auto_raise_delay (int value)
return old != auto_raise_delay;
}
+
+static gboolean
+update_reduced_resources (gboolean value)
+{
+ gboolean old = reduced_resources;
+
+ reduced_resources = value;
+
+ return old != reduced_resources;
+}
#endif /* HAVE_GCONF */
#ifdef WITH_VERBOSE_MODE
@@ -1305,6 +1340,10 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_VISUAL_BELL_TYPE:
return "VISUAL_BELL_TYPE";
break;
+
+ case META_PREF_REDUCED_RESOURCES:
+ return "REDUCED_RESOURCES";
+ break;
}
return "(unknown)";
@@ -1974,6 +2013,12 @@ meta_prefs_get_auto_raise_delay ()
return auto_raise_delay;
}
+gboolean
+meta_prefs_get_reduced_resources ()
+{
+ return reduced_resources;
+}
+
MetaKeyBindingAction
meta_prefs_get_keybinding_action (const char *name)
{