mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Show app name in Kill Application dialog
The "Kill Application" dialog window doesn't always show the application name when killing DockApps. It shows its wm_class instead, which is not always the same as the app name. This patch allows the Kill Application dialog window to show the application name in the window -- as expressed by using the basename of the path to the application. [crmafra: Added wtokensplit() to get only the app name]
This commit is contained in:
committed by
Carlos R. Mafra
parent
108127f0b5
commit
be08535ab4
@@ -383,6 +383,8 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
WApplication *wapp = (WApplication *) entry->clientdata;
|
WApplication *wapp = (WApplication *) entry->clientdata;
|
||||||
WFakeGroupLeader *fPtr;
|
WFakeGroupLeader *fPtr;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
|
char *shortname;
|
||||||
|
char *basename(const char *shortname);
|
||||||
|
|
||||||
if (!WCHECK_STATE(WSTATE_NORMAL))
|
if (!WCHECK_STATE(WSTATE_NORMAL))
|
||||||
return;
|
return;
|
||||||
@@ -391,7 +393,9 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
|
|
||||||
buffer = wstrconcat(wapp->app_icon ? wapp->app_icon->wm_class : NULL,
|
shortname = basename(wapp->app_icon->wm_instance);
|
||||||
|
|
||||||
|
buffer = wstrconcat(wapp->app_icon ? shortname : NULL,
|
||||||
_(" will be forcibly closed.\n"
|
_(" will be forcibly closed.\n"
|
||||||
"Any unsaved changes will be lost.\n" "Please confirm."));
|
"Any unsaved changes will be lost.\n" "Please confirm."));
|
||||||
|
|
||||||
|
|||||||
12
src/dock.c
12
src/dock.c
@@ -206,7 +206,9 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
WScreen *scr = menu->menu->screen_ptr;
|
WScreen *scr = menu->menu->screen_ptr;
|
||||||
WAppIcon *icon;
|
WAppIcon *icon;
|
||||||
WFakeGroupLeader *fPtr;
|
WFakeGroupLeader *fPtr;
|
||||||
char *buffer;
|
char *buffer, *shortname, **argv;
|
||||||
|
char *basename(const char *shortname);
|
||||||
|
int argc;
|
||||||
|
|
||||||
if (!WCHECK_STATE(WSTATE_NORMAL))
|
if (!WCHECK_STATE(WSTATE_NORMAL))
|
||||||
return;
|
return;
|
||||||
@@ -219,7 +221,12 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
|
|
||||||
WCHANGE_STATE(WSTATE_MODAL);
|
WCHANGE_STATE(WSTATE_MODAL);
|
||||||
|
|
||||||
buffer = wstrconcat(icon->wm_class,
|
/* strip away dir names */
|
||||||
|
shortname = basename(icon->command);
|
||||||
|
/* separate out command options */
|
||||||
|
wtokensplit(shortname, &argv, &argc);
|
||||||
|
|
||||||
|
buffer = wstrconcat(argv[0],
|
||||||
_(" will be forcibly closed.\n"
|
_(" will be forcibly closed.\n"
|
||||||
"Any unsaved changes will be lost.\n" "Please confirm."));
|
"Any unsaved changes will be lost.\n" "Please confirm."));
|
||||||
|
|
||||||
@@ -257,6 +264,7 @@ static void killCallback(WMenu * menu, WMenuEntry * entry)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wfree(buffer);
|
wfree(buffer);
|
||||||
|
wtokenfree(argv, argc);
|
||||||
|
|
||||||
icon->editing = 0;
|
icon->editing = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user