From 5dcd31acbe94959656e4d971c0f4b462a0bfb7c7 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Wed, 14 Nov 2012 10:20:27 +0000 Subject: [PATCH] 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. --- src/appicon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appicon.c b/src/appicon.c index 329bd6e3..ac0c4ba7 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -577,9 +577,9 @@ static WMenu *createApplicationMenu(WScreen *scr) WMenu *menu; menu = wMenuCreate(scr, NULL, False); - wMenuAddCallback(menu, _("Launch"), relaunchCallback, NULL); wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL); wMenuAddCallback(menu, _("Hide"), hideCallback, NULL); + wMenuAddCallback(menu, _("Launch"), relaunchCallback, NULL); wMenuAddCallback(menu, _("Set Icon..."), setIconCallback, NULL); wMenuAddCallback(menu, _("Kill"), killCallback, NULL); -- 2.11.4.GIT