1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

appicon: Avoid double 'Hide' entry

On 12.11.2012 Paul Seelig reported:

- open an application positioning an app icon on the bottom
- right click this app icon to show the context menu
- wonder yourself why there are two lines saying "Hide"
- first Hide entry does not do anything, second does

The reason for this curious behavior is the following.

The "Launch" entry was added in 8352c9ef60 ("Allow relaunch with shortcut key")
as the first one in the appicon menu, but this first position was hard-coded
in another part of wmaker's code in order to decide the menu entry text based
on the application's 'hidden' state in openApplicationMenu():

	if (wapp->flags.hidden)
		menu->entries[1]->text = _("Unhide");
	else
		menu->entries[1]->text = _("Hide");

But the "Launch" entry is before these "Hide/Unhide" entries and now the assumption
about entries[1] containing the relevant string for this hide/unhide decision is
no longer valid.

The simpler "fix" is to move the "Launch" entry below these "Hide/Unhide" games.
This commit is contained in:
Carlos R. Mafra
2012-11-14 10:20:27 +00:00
parent 92d52523c4
commit 5dcd31acbe

View File

@@ -577,9 +577,9 @@ static WMenu *createApplicationMenu(WScreen *scr)
WMenu *menu; WMenu *menu;
menu = wMenuCreate(scr, NULL, False); menu = wMenuCreate(scr, NULL, False);
wMenuAddCallback(menu, _("Launch"), relaunchCallback, NULL);
wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL); wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL);
wMenuAddCallback(menu, _("Hide"), hideCallback, NULL); wMenuAddCallback(menu, _("Hide"), hideCallback, NULL);
wMenuAddCallback(menu, _("Launch"), relaunchCallback, NULL);
wMenuAddCallback(menu, _("Set Icon..."), setIconCallback, NULL); wMenuAddCallback(menu, _("Set Icon..."), setIconCallback, NULL);
wMenuAddCallback(menu, _("Kill"), killCallback, NULL); wMenuAddCallback(menu, _("Kill"), killCallback, NULL);