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

Fix a crash in user menu and a menu map bug.

This commit is contained in:
id
1999-05-01 20:59:07 +00:00
parent c2434e8925
commit 94a873707c
2 changed files with 13 additions and 11 deletions

View File

@@ -235,7 +235,8 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
wUserMenuRefreshInstances(napp->menu, wwin);
#endif /* USER_MENU */
wAppMenuMap(napp->menu, wwin);
if (wwin->flags.mapped)
wAppMenuMap(napp->menu, wwin);
#ifdef NEWAPPICON
wApplicationActivate(napp);
#endif

View File

@@ -331,19 +331,20 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
char buffer[100];
char *path = NULL;
char *tmp;
if ( wwin->wm_instance && wwin->wm_class ) {
tmp=wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7);
sprintf(tmp,"%s.%s.menu",wwin->wm_instance,wwin->wm_class);
path = wfindfile(DEF_USER_MENU_PATHS,tmp);
free(tmp);
tmp=wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+7);
sprintf(tmp,"%s.%s.menu",wwin->wm_instance,wwin->wm_class);
path = wfindfile(DEF_USER_MENU_PATHS,tmp);
free(tmp);
if (!path) return NULL;
if (!path) return NULL;
if (wwin) {
menu = readUserMenuFile(scr, path);
}
if (wwin) {
menu = readUserMenuFile(scr, path);
free(path);
}
free(path);
return menu;
}