]> Dogcows Code - chaz/openbox/commitdiff
add an allow_fallback option when opening a theme
authorDana Jansens <danakj@orodu.net>
Thu, 31 May 2007 15:40:41 +0000 (15:40 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 31 May 2007 15:40:41 +0000 (15:40 +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 08d4b07db67b0320614d53ec4eb61f8894a4146d..2b91e765418f051e3c37cb2ca960ebbcce1312fb 100644 (file)
@@ -65,6 +65,7 @@ static gboolean find_appearance(ParseState *ps, xmlNodePtr n, const gchar *names
 #define FIND(type, args...) find_##type(&ps, root, args)
 
 RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
+                    gboolean allow_fallback,
                     RrFont *active_window_font, RrFont *inactive_window_font,
                     RrFont *menu_title_font, RrFont *menu_item_font,
                     RrFont *osd_font)
@@ -85,12 +86,15 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name,
             name = NULL;
         }
     }
-    if (!name) {
+    if (name == NULL && allow_fallback) {
         if (!parse_load_theme(DEFAULT_THEME, &ps.doc, &root, &ps.path)) {
             g_message("Unable to load the theme '%s'", DEFAULT_THEME);
             return NULL;
         }
     }
+    if (name == NULL)
+        return NULL;
+
     ps.inst = inst;
 
     theme = g_new0(RrTheme, 1);
index 911366aebcd4ff0ae17332ea27f82a1300917654..c65fec58179b8429f412c0830ccf3993083e83b5 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, const gchar *theme,
+                    gboolean allow_fallback,
                     RrFont *active_window_font, RrFont *inactive_window_font,
                     RrFont *menu_title_font, RrFont *menu_item_font,
                     RrFont *osd_font);
This page took 0.026812 seconds and 4 git commands to generate.