From: Dana Jansens Date: Wed, 30 May 2007 13:54:52 +0000 (+0000) Subject: merge r7086 from trunk X-Git-Tag: openbox-3_3_995-RELEASE~37 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=82d473a520639ec05d5e75c1de74a5998cac4f08;p=dana%2Fopenbox.git merge r7086 from trunk --- diff --git a/render/theme.c b/render/theme.c index 951bbde5..e5452317 100644 --- a/render/theme.c +++ b/render/theme.c @@ -31,7 +31,7 @@ #include #include -static XrmDatabase loaddb(RrTheme *theme, const gchar *name, gchar **path); +static XrmDatabase loaddb(const gchar *name, gchar **path); static gboolean read_int(XrmDatabase db, const gchar *rname, gint *value); static gboolean read_string(XrmDatabase db, const gchar *rname, gchar **value); static gboolean read_color(XrmDatabase db, const RrInstance *inst, @@ -58,6 +58,23 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, gchar *path; gboolean userdef; + if (name) { + db = loaddb(name, &path); + if (db == NULL) { + g_message("Unable to load the theme '%s'", name); + g_message("Falling back to the default theme '%s'", + DEFAULT_THEME); + } + } + if (db == NULL) { + db = loaddb(DEFAULT_THEME, &path); + if (db == NULL) { + g_message("Unable to load the theme '%s'", DEFAULT_THEME); + return NULL; + } + name = DEFAULT_THEME; + } + theme = g_new0(RrTheme, 1); theme->inst = inst; @@ -98,22 +115,6 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, theme->a_clear = RrAppearanceNew(inst, 0); theme->a_clear_tex = RrAppearanceNew(inst, 1); - if (name) { - db = loaddb(theme, name, &path); - if (db == NULL) { - g_message("Unable to load the theme '%s'", name); - g_message("Falling back to the default theme '%s'", - DEFAULT_THEME); - } - } - if (db == NULL) { - db = loaddb(theme, DEFAULT_THEME, &path); - if (db == NULL) { - g_message("Unable to load the theme '%s'", DEFAULT_THEME); - return NULL; - } - } - /* load the font stuff */ if (active_window_font) { theme->win_font_focused = active_window_font; @@ -1402,7 +1403,7 @@ void RrThemeFree(RrTheme *theme) } } -static XrmDatabase loaddb(RrTheme *theme, const gchar *name, gchar **path) +static XrmDatabase loaddb(const gchar *name, gchar **path) { GSList *it; XrmDatabase db = NULL;