mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-31 19:12:32 +01:00
Prefer TryExec to Exec when generating menu entries from XDG desktop files.
From the comments at the top of wmmenugen_parse_xdg.c: Since there is no passing of file name arguments or anything of the sort to applications from the menu, execname is determined as follows: - If `TryExec' is present, use that; - else use `Exec' with any switches stripped However, Exec used to be preferred. Changed code to prefer TryExec. Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:
committed by
Carlos R. Mafra
parent
9330a021e5
commit
4477ae4da4
@@ -212,22 +212,23 @@ static Bool xdg_to_wm(XDGMenuEntry *xdg, WMMenuEntry *wm)
|
|||||||
if (xdg->Name) {
|
if (xdg->Name) {
|
||||||
wm->Name = xdg->Name;
|
wm->Name = xdg->Name;
|
||||||
} else {
|
} else {
|
||||||
if (xdg->Exec)
|
if (xdg->TryExec)
|
||||||
wm->Name = wstrdup(xdg->Exec);
|
|
||||||
else /* xdg->TryExec */
|
|
||||||
wm->Name = wstrdup(xdg->TryExec);
|
wm->Name = wstrdup(xdg->TryExec);
|
||||||
|
else /* xdg->Exec */
|
||||||
|
wm->Name = wstrdup(xdg->Exec);
|
||||||
|
|
||||||
p = strchr(wm->Name, ' ');
|
p = strchr(wm->Name, ' ');
|
||||||
if (p)
|
if (p)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xdg->Exec) {
|
if (xdg->TryExec)
|
||||||
|
wm->CmdLine = xdg->TryExec;
|
||||||
|
else { /* xdg->Exec */
|
||||||
wm->CmdLine = parse_xdg_exec(xdg->Exec);
|
wm->CmdLine = parse_xdg_exec(xdg->Exec);
|
||||||
if (!wm->CmdLine)
|
if (!wm->CmdLine)
|
||||||
return False;
|
return False;
|
||||||
} else /* xdg->TryExec */
|
}
|
||||||
wm->CmdLine = xdg->TryExec;
|
|
||||||
|
|
||||||
wm->SubMenu = xdg->Category;
|
wm->SubMenu = xdg->Category;
|
||||||
wm->Flags = xdg->Flags;
|
wm->Flags = xdg->Flags;
|
||||||
|
|||||||
Reference in New Issue
Block a user