mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 05:18:06 +01:00
src/usermenu.c: updated wUserMenuRefreshInstances
remove unused var and move wwin check Acked-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
867f221ead
commit
9456252d51
@@ -279,7 +279,6 @@ static WMenu *configureUserMenu(WScreen * scr, WMPropList * plum)
|
|||||||
|
|
||||||
void wUserMenuRefreshInstances(WMenu * menu, WWindow * wwin)
|
void wUserMenuRefreshInstances(WMenu * menu, WWindow * wwin)
|
||||||
{
|
{
|
||||||
WMenuEntry *entry;
|
|
||||||
int i, j, count, paintflag;
|
int i, j, count, paintflag;
|
||||||
|
|
||||||
paintflag = 0;
|
paintflag = 0;
|
||||||
@@ -335,7 +334,7 @@ WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin)
|
|||||||
WMenu *menu = NULL;
|
WMenu *menu = NULL;
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
if (wwin->wm_instance && wwin->wm_class) {
|
if (wwin && wwin->wm_instance && wwin->wm_class) {
|
||||||
int len = strlen(wwin->wm_instance) + strlen(wwin->wm_class) + 7;
|
int len = strlen(wwin->wm_instance) + strlen(wwin->wm_class) + 7;
|
||||||
tmp = wmalloc(len);
|
tmp = wmalloc(len);
|
||||||
snprintf(tmp, len, "%s.%s.menu", wwin->wm_instance, wwin->wm_class);
|
snprintf(tmp, len, "%s.%s.menu", wwin->wm_instance, wwin->wm_class);
|
||||||
@@ -345,9 +344,7 @@ WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin)
|
|||||||
if (!path)
|
if (!path)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (wwin)
|
menu = readUserMenuFile(scr, path);
|
||||||
menu = readUserMenuFile(scr, path);
|
|
||||||
|
|
||||||
wfree(path);
|
wfree(path);
|
||||||
}
|
}
|
||||||
return menu;
|
return menu;
|
||||||
|
|||||||
Reference in New Issue
Block a user