summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-11-11 19:16:11 +0100
committerDanny Baumann <dannybaumann@web.de>2007-11-11 19:16:11 +0100
commit032aac16526ba84661e6d8315193fe356602a960 (patch)
tree704e7211e04913ff9253671cdca18786def1be89 /gtk
parent852b20d365014e82695c76bb6bfc9ec6565e1419 (diff)
Give options passed over the command line priority over ones from gconf.
To do that, store flags which options were passed and don't use the gconf values for those.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/window-decorator/gtk-window-decorator.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 358475db..9f236c2b 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -181,6 +181,13 @@
#define META_ACTIVE_OPACITY 1.0
#define META_ACTIVE_SHADE_OPACITY TRUE
+#define CMDLINE_OPACITY (1 << 0)
+#define CMDLINE_OPACITY_SHADE (1 << 1)
+#define CMDLINE_ACTIVE_OPACITY (1 << 2)
+#define CMDLINE_ACTIVE_OPACITY_SHADE (1 << 3)
+#define CMDLINE_BLUR (1 << 4)
+#define CMDLINE_THEME (1 << 5)
+
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_DECOR_ALL (1L << 0)
@@ -283,6 +290,8 @@ static gboolean meta_button_layout_set = FALSE;
static MetaButtonLayout meta_button_layout;
#endif
+static guint cmdline_options = 0;
+
static decor_shadow_t *no_border_shadow = NULL;
static decor_shadow_t *border_shadow = NULL;
static decor_shadow_t *max_border_shadow = NULL;
@@ -6099,6 +6108,9 @@ blur_settings_changed (GConfClient *client)
gchar *type;
int new_type = blur_type;
+ if (cmdline_options & CMDLINE_BLUR)
+ return FALSE;
+
type = gconf_client_get_string (client,
BLUR_TYPE_KEY,
NULL);
@@ -6131,6 +6143,9 @@ theme_changed (GConfClient *client)
#ifdef USE_METACITY
gboolean use_meta_theme;
+ if (cmdline_options & CMDLINE_THEME)
+ return FALSE;
+
use_meta_theme = gconf_client_get_bool (client,
USE_META_THEME_KEY,
NULL);
@@ -6199,7 +6214,8 @@ theme_opacity_changed (GConfClient *client)
META_THEME_OPACITY_KEY,
NULL);
- if (opacity != meta_opacity)
+ if (!(cmdline_options & CMDLINE_OPACITY) &&
+ opacity != meta_opacity)
{
meta_opacity = opacity;
changed = TRUE;
@@ -6211,7 +6227,8 @@ theme_opacity_changed (GConfClient *client)
META_THEME_SHADE_OPACITY_KEY,
NULL);
- if (shade_opacity != meta_shade_opacity)
+ if (!(cmdline_options & CMDLINE_OPACITY_SHADE) &&
+ shade_opacity != meta_shade_opacity)
{
meta_shade_opacity = shade_opacity;
changed = TRUE;
@@ -6222,7 +6239,8 @@ theme_opacity_changed (GConfClient *client)
META_THEME_ACTIVE_OPACITY_KEY,
NULL);
- if (opacity != meta_active_opacity)
+ if (!(cmdline_options & CMDLINE_ACTIVE_OPACITY) &&
+ opacity != meta_active_opacity)
{
meta_active_opacity = opacity;
changed = TRUE;
@@ -6235,7 +6253,8 @@ theme_opacity_changed (GConfClient *client)
META_THEME_ACTIVE_SHADE_OPACITY_KEY,
NULL);
- if (shade_opacity != meta_active_shade_opacity)
+ if (!(cmdline_options & CMDLINE_ACTIVE_OPACITY_SHADE) &&
+ shade_opacity != meta_active_shade_opacity)
{
meta_active_shade_opacity = shade_opacity;
changed = TRUE;
@@ -6719,6 +6738,7 @@ main (int argc, char *argv[])
else if (strcmp (argv[i], "all") == 0)
blur_type = BLUR_TYPE_ALL;
}
+ cmdline_options |= CMDLINE_BLUR;
}
#ifdef USE_METACITY
@@ -6726,24 +6746,29 @@ main (int argc, char *argv[])
{
if (argc > ++i)
meta_opacity = atof (argv[i]);
+ cmdline_options |= CMDLINE_OPACITY;
}
else if (strcmp (argv[i], "--no-opacity-shade") == 0)
{
meta_shade_opacity = FALSE;
+ cmdline_options |= CMDLINE_OPACITY_SHADE;
}
else if (strcmp (argv[i], "--active-opacity") == 0)
{
if (argc > ++i)
meta_active_opacity = atof (argv[i]);
+ cmdline_options |= CMDLINE_ACTIVE_OPACITY;
}
else if (strcmp (argv[i], "--no-active-opacity-shade") == 0)
{
meta_active_shade_opacity = FALSE;
+ cmdline_options |= CMDLINE_ACTIVE_OPACITY_SHADE;
}
else if (strcmp (argv[i], "--metacity-theme") == 0)
{
if (argc > ++i)
meta_theme = argv[i];
+ cmdline_options |= CMDLINE_THEME;
}
#endif