diff options
author | rbuj <[email protected]> | 2021-02-24 11:13:37 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2021-02-26 20:00:26 +0000 |
commit | d06135111f8ebe5572b1ed9c01f6c04378a1d6d3 (patch) | |
tree | 9aa4bfdbdf57d9eabbfd8be7f411b73132ee21e5 | |
parent | e1f9588ddc1cd2c0731e304da8cfbfca643aa191 (diff) | |
download | mate-control-center-d06135111f8ebe5572b1ed9c01f6c04378a1d6d3.tar.bz2 mate-control-center-d06135111f8ebe5572b1ed9c01f6c04378a1d6d3.tar.xz |
marco-window-manager: get XDG_DATA_DIRS (code portability)
-rw-r--r-- | libwindow-settings/marco-window-manager.c | 15 |
1 files 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; } |