X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=parser%2Fparse.c;h=167456509e63a44e983ba1660dfb0f4669700ef4;hb=24c0d618471276fd514cd666bc7067d30be8d0ca;hp=43d076e1e95450eb11e699f5e77ad7e8982c7913;hpb=974391d345adf122816831cc24cbdfec5616aed1;p=chaz%2Fopenbox diff --git a/parser/parse.c b/parser/parse.c index 43d076e1..16745650 100644 --- a/parser/parse.c +++ b/parser/parse.c @@ -108,20 +108,35 @@ gboolean parse_load_theme(const gchar *name, xmlDocPtr *doc, xmlNodePtr *root, GSList *it; gchar *path; gboolean r = FALSE; + gchar *eng; /* backward compatibility.. */ path = g_build_filename(g_get_home_dir(), ".themes", name, "openbox-3", "themerc.xml", NULL); - if ((r = parse_load(path, "openbox_theme", doc, root))) - *retpath = g_path_get_dirname(path); + if (parse_load(path, "openbox_theme", doc, root) && + parse_attr_string("engine", *root, &eng)) + { + if (!strcmp(eng, "box")) { + *retpath = g_path_get_dirname(path); + r = TRUE; + } + g_free(eng); + } g_free(path); if (!r) { for (it = xdg_data_dir_paths; !r && it; it = g_slist_next(it)) { path = g_build_filename(it->data, "themes", name, "openbox-3", "themerc.xml", NULL); - if ((r = parse_load(path, "openbox_theme", doc, root))) - *retpath = g_path_get_dirname(path); + if (parse_load(path, "openbox_theme", doc, root) && + parse_attr_string("engine", *root, &eng)) + { + if (!strcmp(eng, "box")) { + *retpath = g_path_get_dirname(path); + r = TRUE; + } + g_free(eng); + } g_free(path); } }