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-04-04 15:33:07 +0300
commit9a935911569a8a1c6f7c798d96f9697bb70031a9 (patch)
treeb52a2f2680c5b3dc4560b6475689a2320e12a1fb
parent649f588ce99ca2962291ce43b5708573ae99b9aa (diff)
downloadmetacity-9a935911569a8a1c6f7c798d96f9697bb70031a9.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;