1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 07:02:30 +01:00

WPrefs: Fetch default menu from system path

If you delete the file ~GNUStep/Defaults/WMRootMenu and run WMPrefs
and go to the Menu Edit tab, it will show a dialog about keeping the menu or
discarding it. If you discard it then WPrefs shows an error:

"Could not open default menu from
'/home/user/GNUStep/Library/WindowMaker/plmenu"

The problem is at WPrefs.app/Menu.c:1424, and it happens because it tries
to load the default menu from the user's GNUstep home, but plmenu is not
copied there during the installation.

Of course, the file doesn't need to be copied to the users home, so
WPrefs should try to read it from /usr/share/WindowMaker/plmenu (Debian)
or /usr/local/share/WindowMaker/plmenu (upstream).
This commit is contained in:
Rodolfo Garc??a Pe??as (kix)
2012-01-12 19:07:05 +01:00
committed by Carlos R. Mafra
parent 7013467da4
commit 6ae01b9d90
2 changed files with 5 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ WPrefs_SOURCES = \
editmenu.h \
xmodifier.c
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(wpdatadir)\"
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(wpdatadir)\" -DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\"
AM_CFLAGS =
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@

View File

@@ -41,6 +41,7 @@ typedef enum {
} InfoType;
#define MAX_SECTION_SIZE 4
#define PATH_LEN 256
typedef struct _Panel {
WMBox *box;
@@ -1426,10 +1427,10 @@ static WMPropList *getDefaultMenu(_Panel * panel)
WMPropList *menu;
char *menuPath, *gspath;
gspath = wusergnusteppath();
gspath = wstrdup(WMAKER_RESOURCE_PATH);
menuPath = wmalloc(strlen(gspath) + 128);
sprintf(menuPath, "%s/Library/WindowMaker/plmenu", gspath);
sprintf(menuPath, "%s/plmenu", gspath);
menu = WMReadPropListFromFile(menuPath);
@@ -1444,6 +1445,7 @@ static WMPropList *getDefaultMenu(_Panel * panel)
wfree(buffer);
}
wfree(gspath);
wfree(menuPath);
return menu;