appicon: Avoid double 'Hide' entry
commit5dcd31acbe94959656e4d971c0f4b462a0bfb7c7
authorCarlos R. Mafra <crmafra@gmail.com>
Wed, 14 Nov 2012 10:20:27 +0000 (14 10:20 +0000)
committerCarlos R. Mafra <crmafra@gmail.com>
Wed, 14 Nov 2012 10:20:32 +0000 (14 10:20 +0000)
tree8e639edc7ab941f03feb2eba2ca438243d76c534
parent92d52523c411d10be08e3af28fc5ac924b2f5075
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