From 90e502c03baf4ef40fe7c090446d7b7b30d9940d Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 31 May 2007 15:42:14 +0000 Subject: [PATCH] merge r7162-7163 from trunk --- openbox/openbox.c | 2 +- render/theme.c | 10 +++++++--- render/theme.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/openbox/openbox.c b/openbox/openbox.c index 9b81f200..cfc6f036 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -261,7 +261,7 @@ gint main(gint argc, gchar **argv) /* load the theme specified in the rc file */ { RrTheme *theme; - if ((theme = RrThemeNew(ob_rr_inst, config_theme, + if ((theme = RrThemeNew(ob_rr_inst, config_theme, TRUE, config_font_activewindow, config_font_inactivewindow, config_font_menutitle, diff --git a/render/theme.c b/render/theme.c index 733b6b16..680a8891 100644 --- a/render/theme.c +++ b/render/theme.c @@ -47,6 +47,7 @@ static RrPixel32* read_c_image(gint width, gint height, const guint8 *data); static void set_default_appearance(RrAppearance *a); RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, + gboolean allow_fallback, RrFont *active_window_font, RrFont *inactive_window_font, RrFont *menu_title_font, RrFont *menu_item_font, RrFont *osd_font) @@ -62,19 +63,22 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *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 (allow_fallback) + g_message("Falling back to the default theme '%s'", + DEFAULT_THEME); /* fallback to the default theme */ name = NULL; } } - if (db == NULL) { + if (name == NULL && allow_fallback) { db = loaddb(DEFAULT_THEME, &path); if (db == NULL) { g_message("Unable to load the theme '%s'", DEFAULT_THEME); return NULL; } } + if (name == NULL) + return NULL; theme = g_new0(RrTheme, 1); diff --git a/render/theme.h b/render/theme.h index dda67071..31e3d65f 100644 --- a/render/theme.h +++ b/render/theme.h @@ -236,6 +236,7 @@ struct _RrTheme { /*! The font values are all optional. If a NULL is used for any of them, then the default font will be used. */ RrTheme* RrThemeNew(const RrInstance *inst, gchar *theme, + gboolean allow_fallback, RrFont *active_window_font, RrFont *inactive_window_font, RrFont *menu_title_font, RrFont *menu_item_font, RrFont *osd_font); -- 2.34.1