From d06135111f8ebe5572b1ed9c01f6c04378a1d6d3 Mon Sep 17 00:00:00 2001 From: rbuj Date: Wed, 24 Feb 2021 11:13:37 +0100 Subject: marco-window-manager: get XDG_DATA_DIRS (code portability) --- libwindow-settings/marco-window-manager.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libwindow-settings/marco-window-manager.c b/libwindow-settings/marco-window-manager.c index 2340ae27..74b872c0 100644 --- a/libwindow-settings/marco-window-manager.c +++ b/libwindow-settings/marco-window-manager.c @@ -163,15 +163,22 @@ marco_get_theme_list (MateWindowManager *wm) { GList *themes = NULL; char *home_dir_themes; + const gchar* const* xdg_data_dirs; + int i; home_dir_themes = g_build_filename (g_get_home_dir (), ".themes", NULL); - - themes = add_themes_from_dir (themes, MARCO_THEME_DIR); - themes = add_themes_from_dir (themes, "/usr/share/themes"); themes = add_themes_from_dir (themes, home_dir_themes); - g_free (home_dir_themes); + xdg_data_dirs = g_get_system_data_dirs (); + for (i = 0; xdg_data_dirs[i] != NULL; i++) { + char *sys_dir_themes = g_build_filename (xdg_data_dirs[i], "themes", NULL); + themes = add_themes_from_dir (themes, sys_dir_themes); + g_free (sys_dir_themes); + } + + themes = add_themes_from_dir (themes, MARCO_THEME_DIR); + return themes; } -- cgit v1.2.1