summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-01-21 00:01:07 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-02-19 23:21:55 +0200
commite057bb0da463917e8a7d8a3fc9054cf8f5b5bde8 (patch)
treedf269fea39817015f67a90653eea853983310282
parent8e5781bc3d0ddab13afecc35dc9db101b028680c (diff)
downloadmetacity-e057bb0da463917e8a7d8a3fc9054cf8f5b5bde8.tar.gz
theme: allow NULL as theme name
Theme name == NULL - use current GTK+ theme.
-rw-r--r--src/core/prefs.c9
-rw-r--r--src/ui/theme.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 5d3d23a8..1f2c6a0b 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -999,15 +999,16 @@ theme_name_handler (GVariant *value,
*result = NULL; /* ignored */
string_value = g_variant_get_string (value, NULL);
- if (!string_value || !*string_value)
- return FALSE;
-
if (g_strcmp0 (current_theme, string_value) != 0)
{
if (current_theme)
g_free (current_theme);
- current_theme = g_strdup (string_value);
+ if (!string_value || !*string_value)
+ current_theme = NULL;
+ else
+ current_theme = g_strdup (string_value);
+
queue_changed (META_PREF_THEME);
}
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 132e70b4..e875f0e8 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5361,7 +5361,7 @@ meta_theme_set_current (const char *name,
if (!force_reload &&
meta_current_theme &&
- strcmp (name, meta_current_theme->name) == 0)
+ g_strcmp0 (name, meta_current_theme->name) == 0)
return;
err = NULL;