diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-09-15 19:20:05 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-09-15 19:20:05 +0000 |
| commit | c1b2fc5324522f74a14a5cfa210c95e1509a6e7f (patch) | |
| tree | 7024fd9c49d64e29d3f622250199c5d6a382b721 /render | |
| parent | 3a607fad9df628ab16e0f7436dfbfc9b22634003 (diff) | |
make openbox base-dir spec compliant, and change the theme dir structure, so that themes go in $XDG_DATA_DIRS/themes/ with gtk/metacity/whateverelse themes
Diffstat (limited to 'render')
| -rw-r--r-- | render/obrender-3.0.pc.in | 2 | ||||
| -rw-r--r-- | render/theme.c | 29 |
2 files changed, 20 insertions, 11 deletions
diff --git a/render/obrender-3.0.pc.in b/render/obrender-3.0.pc.in index 11a9177b..ab908ac1 100644 --- a/render/obrender-3.0.pc.in +++ b/render/obrender-3.0.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: ObRender Description: Openbox Render Library Version: @VERSION@ -Requires: +Requires: obparser-3.0 Libs: -L${libdir} -lobrender Cflags: -I${includedir}/openbox/@OB_VERSION@ diff --git a/render/theme.c b/render/theme.c index 907fd0b5..8ad8c841 100644 --- a/render/theme.c +++ b/render/theme.c @@ -4,6 +4,7 @@ #include "mask.h" #include "theme.h" #include "icon.h" +#include "parser/parse.h" #include <X11/Xlib.h> #include <X11/Xresource.h> @@ -1059,21 +1060,29 @@ void RrThemeFree(RrTheme *theme) static XrmDatabase loaddb(RrTheme *theme, char *name) { - XrmDatabase db; + GSList *it; + XrmDatabase db = NULL; + gchar *s; - char *s = g_build_filename(g_get_home_dir(), ".openbox", "themes", - name, "themerc", NULL); - if ((db = XrmGetFileDatabase(s))) - theme->path = g_path_get_dirname(s); - g_free(s); - if (db == NULL) { - char *s = g_build_filename(THEMEDIR, name, "themerc", NULL); + if (name[0] == '/') { + s = g_build_filename(name, "openbox-3", "themerc", NULL); if ((db = XrmGetFileDatabase(s))) theme->path = g_path_get_dirname(s); - g_free(s); + g_free(s); + } else { + for (it = parse_xdg_data_dir_paths(); !db && it; + it = g_slist_next(it)) + { + s = g_build_filename(it->data, "themes", name, + "openbox-3", "themerc", NULL); + if ((db = XrmGetFileDatabase(s))) + theme->path = g_path_get_dirname(s); + g_free(s); + } } + if (db == NULL) { - char *s = g_build_filename(name, "themerc", NULL); + s = g_build_filename(name, "themerc", NULL); if ((db = XrmGetFileDatabase(s))) theme->path = g_path_get_dirname(s); g_free(s); |
