GNOME Bugzilla – Bug 743610
Maximize/Minimize buttons conflict with appmenu button
Last modified: 2015-03-16 19:44:36 UTC
I've found a conflict with maximize/minimize and appmenu buttons. If I disable the "Show Application Menu" option, the Application Menu appears as a button in Nautilus. Using dconf-editor it looks like this: [aitor@falc ~]$ gsettings get org.gnome.desktop.wm.preferences button-layout 'appmenu:close' Then, if I enable maximize and minimize buttons, the appmenu button disappears: [aitor@falc ~]$ gsettings get org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close' And if I disable the maximize and minimize buttons, the appmenu is still missing: [aitor@falc ~]$ gsettings get org.gnome.desktop.wm.preferences button-layout ':close' At this point, nothing changes when I enable and disable "Show Application Menu". So gnome-tweak-tool is preventing the appmenu button from appearing in the button layout. It is possible to set all of them manually by entering: [aitor@falc ~]$ gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize:maximize:close'
Well, I thought 'appmenu:minimize:maximize:close' is working but it seems that appmenu works with 'appmenu:minimize', 'appmenu:maximize' and 'appmenu:close', but it doesn't work if there are more than two buttons in the layout.
(In reply to comment #1) > Well, I thought 'appmenu:minimize:maximize:close' is working but it seems that > appmenu works with 'appmenu:minimize', 'appmenu:maximize' and 'appmenu:close', > but it doesn't work if there are more than two buttons in the layout. I think you need to use commas instead of colons for separating buttons. This works fine for me: $ gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:minimize,maximize,close'
I can confirm this issue. On Fedora 21/Gnome 3.14.2, the default value of button-layout is: $ gsettings get org.gnome.desktop.wm.preferences button-layout 'appmenu:close' gnome-tweak-tool doesn't take the "appmenu" into account and silently drops it when enabling/disabling minimize/maximize buttons. What's worse, the first time user runs the gnome-tweak-tool and tries to enable either of the buttons, it always enables both of them. How to reproduce it: 1. $ gsettings set org.gnome.desktop.wm.preferences button-layout 'appmenu:close' 2. run gnome-tweak-tool, go to "Windows" and try to enable either "minimize" or "maximize" button. No matter which one you choose, both of them will be enabled. $ gsettings get org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close' And the "appmenu" is gone.
Created attachment 295836 [details] [review] proposed patch
Review of attachment 295836 [details] [review]: thanks for the patch ::: gtweak/tweaks/tweak_group_windows.py @@ +49,3 @@ + for key in buttons.keys(): + result = re.search("(?:^|[:,]){b}(?:[:,]|$)".format(b=key), val) + if result: Do we really need a regexp for this? if key in val: should work just fine. @@ +64,3 @@ + val += "," + val += button + need_comma = True if you create a list with the words that are to be added you can then simply do: string.join(list_variable, ',')
Created attachment 299548 [details] [review] windows: Take other buttons into account when changing button layout -- Michal, thanks again for the patch but besides the style issues your patch doesn't handle other possible values in the gsettings key so I decided to go with this instead.
Attachment 299548 [details] pushed as 69f3ece - windows: Take other buttons into account when changing button layout