1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Change directory for user menus and add global directory for them.

This commit is contained in:
id
1999-04-17 10:08:13 +00:00
parent 416f28248c
commit 57f0f4b245
2 changed files with 18 additions and 16 deletions

View File

@@ -92,6 +92,9 @@ notifyClient(WMenu *menu, WMenuEntry *entry){
event.xkey.same_screen = YES; event.xkey.same_screen = YES;
XSendEvent(dpy, window, False, NoEventMask, &event); XSendEvent(dpy, window, False, NoEventMask, &event);
XFlush(dpy); XFlush(dpy);
event.xkey.type = KeyRelease;
XSendEvent(dpy, window, False, NoEventMask, &event);
XFlush(dpy);
} }
} }
@@ -322,27 +325,20 @@ WMenu*
wUserMenuGet(WScreen *scr, WWindow *wwin){ wUserMenuGet(WScreen *scr, WWindow *wwin){
WMenu *menu = NULL; WMenu *menu = NULL;
char buffer[100]; char buffer[100];
char *prefix, *menufile; char *path = NULL;
char *tmp;
prefix = getenv("HOME"); tmp=wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7);
if (!prefix) path = wfindfile(DEF_USER_MENU_PATHS,tmp);
prefix = "."; free(tmp);
/* this file/path code will be replaced :D - ]d */
menufile = malloc(strlen(prefix)+128); if (!path) return NULL;
if (!menufile) return NULL;
if (wwin) { if (wwin) {
FILE *f; menu = readUserMenuFile(scr, path);
sprintf(menufile, "%s/GNUstep/Library/WindowMaker/UserMenus/%s.%s.menu",
prefix, wwin->wm_instance, wwin->wm_class);
f = fopen(menufile, "r");
if (f) {
fclose(f);
menu = readUserMenuFile(scr, menufile);
}
} }
free(menufile); free(path);
return menu; return menu;
} }

View File

@@ -274,6 +274,12 @@
#define DEF_PIXMAP_PATHS \ #define DEF_PIXMAP_PATHS \
"(\"~/pixmaps\",\"~/GNUstep/Library/WindowMaker/Pixmaps\",\""PIXMAPDIR"\")" "(\"~/pixmaps\",\"~/GNUstep/Library/WindowMaker/Pixmaps\",\""PIXMAPDIR"\")"
#ifdef USER_MENU
#define GLOBAL_USER_MENU_PATH SYSCONFDIR"/UserMenus"
#define DEF_USER_MENU_PATHS \
"~/GNUstep/Defaults/UserMenus:"GLOBAL_USER_MENU_PATH
#endif
/* icon path */ /* icon path */
#define DEF_ICON_PATHS \ #define DEF_ICON_PATHS \
"(\"~/pixmaps\",\"~/GNUstep/Library/Icons\",\"/usr/include/X11/pixmaps/\",\""PIXMAPDIR"\")" "(\"~/pixmaps\",\"~/GNUstep/Library/Icons\",\"/usr/include/X11/pixmaps/\",\""PIXMAPDIR"\")"