diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index feadd5fb..a18e495e 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -22,6 +22,7 @@ #include "WPrefs.h" #include #include +#include #include #include @@ -1493,6 +1494,26 @@ static void showData(_Panel * panel) pmenu = WMReadPropListFromFile(menuPath); + /* check if WMRootMenu references another file, and if so, + if that file is in proplist format */ + while (WMIsPLString(pmenu)) { + char *path = NULL; + + path = wexpandpath(WMGetFromPLString(pmenu)); + + if (access(path, F_OK) < 0) + path = wfindfile(DEF_CONFIG_PATHS, path); + + /* TODO: if needed, concatenate locale suffix to path. + See getLocalizedMenuFile() in src/rootmenu.c. */ + + if (!path) + break; + + pmenu = WMReadPropListFromFile(path); + wfree(path); + } + if (!pmenu || !WMIsPLArray(pmenu)) { int res;