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:
@@ -235,7 +235,8 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
|||||||
wUserMenuRefreshInstances(napp->menu, wwin);
|
wUserMenuRefreshInstances(napp->menu, wwin);
|
||||||
#endif /* USER_MENU */
|
#endif /* USER_MENU */
|
||||||
|
|
||||||
wAppMenuMap(napp->menu, wwin);
|
if (wwin->flags.mapped)
|
||||||
|
wAppMenuMap(napp->menu, wwin);
|
||||||
#ifdef NEWAPPICON
|
#ifdef NEWAPPICON
|
||||||
wApplicationActivate(napp);
|
wApplicationActivate(napp);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -331,19 +331,20 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
|
|||||||
char buffer[100];
|
char buffer[100];
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
char *tmp;
|
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);
|
if (!path) return NULL;
|
||||||
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 (wwin) {
|
||||||
|
menu = readUserMenuFile(scr, path);
|
||||||
|
}
|
||||||
|
|
||||||
if (wwin) {
|
free(path);
|
||||||
menu = readUserMenuFile(scr, path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(path);
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user