After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743610 - Maximize/Minimize buttons conflict with appmenu button
Maximize/Minimize buttons conflict with appmenu button
Status: RESOLVED FIXED
Product: gnome-tweak-tool
Classification: Applications
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-27 22:56 UTC by Falc
Modified: 2015-03-16 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.84 KB, patch)
2015-01-30 22:52 UTC, Michal Srb
rejected Details | Review
windows: Take other buttons into account when changing button layout (2.48 KB, patch)
2015-03-16 19:42 UTC, Rui Matos
committed Details | Review

Description Falc 2015-01-27 22:56:06 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'
Comment 1 Falc 2015-01-27 23:07:21 UTC
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.
Comment 2 Michal Srb 2015-01-30 22:22:52 UTC
(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'
Comment 3 Michal Srb 2015-01-30 22:42:14 UTC
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.
Comment 4 Michal Srb 2015-01-30 22:52:08 UTC
Created attachment 295836 [details] [review]
proposed patch
Comment 5 Rui Matos 2015-02-15 00:00:05 UTC
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, ',')
Comment 6 Rui Matos 2015-03-16 19:42:55 UTC
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.
Comment 7 Rui Matos 2015-03-16 19:44:30 UTC
Attachment 299548 [details] pushed as 69f3ece - windows: Take other buttons into account when changing button layout