merge r7162-7163 from trunk
authorDana Jansens <danakj@orodu.net>
Thu, 31 May 2007 15:42:14 +0000 (15:42 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 31 May 2007 15:42:14 +0000 (15:42 +0000)
openbox/openbox.c
render/theme.c
render/theme.h

index 9b81f2009463f6b62f1549cceb4e8761fa547f23..cfc6f036910eae5731f401b1f8f961e28a909054 100644 (file)
@@ -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,
index 733b6b1696d3f50c5e1b29945a6db235f1f38759..680a889116c139796bb7a50df8be6571e2a4f3cd 100644 (file)
@@ -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);
 
index dda67071a91e24d3301493c5fd3d8ad11019d0a0..31e3d65feb159095fee26428c7c1fa0ea2791423 100644 (file)
@@ -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);