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 757044 - Button layout preference ignored
Button layout preference ignored
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
3.18.x
Other Linux
: Normal major
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2015-10-24 08:39 UTC by Sergey Tereschenko
Modified: 2016-01-12 21:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
prefs: use Gtk/DecorationLayout only under GNOME-Flashback (1.53 KB, patch)
2015-10-30 19:03 UTC, Alberts Muktupāvels
committed Details | Review

Description Sergey Tereschenko 2015-10-24 08:39:49 UTC
In current version of metacity button layout can not be changed.

I digged source code, and found in src/core/prefs.c option button-layout from org.gnome.desktop.wm.preferences must be used. But it's seems to be ignored.

After digging further i tracked down issue to release 3.17.2 where this was broken.

I cloned code from git, and found exact source of problem: 

> commit: 5e694c3935c838bb2d1179d3cbb6da61f433a5c1
> Author: Alberts Muktupāvels <alberts.muktupavels@gmail.com>  2015-06-04 17:04:51
> prefs: use button layout from GtkSettings

So, i tried to change Gtk DecorationLayout, following this page: http://roman-yagodin.github.io/how-to/2015/05/24/gtk-decoration-layout/
(by editing ~/.config/gtk-3.0/setting.ini)


Seems like it does not work either.


This can be fixed by reverting that commit (i just reverted it myself, compiled, works as expected)
> gsettings set org.gnome.desktop.wm.preferences button-layout 'close,maximize,minimize:menu'
window control button now on the left side.

Or someone must investigate why it does not respect button-layout from GtkSettings, i don't have much expirience with gtk or c.
Comment 1 Alberts Muktupāvels 2015-10-30 17:50:02 UTC
What desktop environment do you use?

gnome-settings-daemon reads button-layout and translates to gtk-decoration-layout
metacity use GtkSettings to get gtk-decoration-layout and translates back to button-layout.

In GNOME-Flashback environment gnome-flashback application will overwrite changes from gnome-settings-daemon since we need different button-layout and there is still no way to set different default values for different sessions. So if you use GNOME Flashback desktop environment then you can change button-layout with dconf editor - org.gnome.gnome-flashback.workarounds fix-button-layout.

If you use other desktop environment then most likely there is application that changes gtk-decoration-layout - that is why using settings.ini does not work. gnome-settings-daemon and/or unity-settings-daemon has xsettings plugin were you can set Gtk/DecorationLayout. org.gnome.settings-daemon.plugins.xsettings overrides. There you can set your layout - {'Gtk/DecorationLayout': <'your-botton-layout'>}.

I will revert this only when this bug will be fixed:
https://bugzilla.gnome.org/show_bug.cgi?id=746592

I might change this so gtk-decoration-layout is only used in GNOME-Flashback and in other environments still use button-layout...
Comment 2 Sergey Tereschenko 2015-10-30 18:19:41 UTC
I use gnome-flashback.

I changed fix-button-layout to empty string, and now my decorations works as expected.

Hovewer, if i set fix-button-layout to "close,maximize,minimize:menu", there is no "menu" button at the left.
Comment 3 Alberts Muktupāvels 2015-10-30 18:33:54 UTC
First I guess you mean - at the right not left, right?

button-layout: menu, appmenu, minimize, maximize, close
Gtk/DecorationLayout: icon, menu, minimize, maximize, close

So 'menu' button in button-layout is not same thing in fix-button-layout (Gtk/DecorationLayout).

If you use "close,maximize,minimize:menu" in button-layout then in fix-button-layout right value is "close,maximize,minimize:icon". But with this you will be missing application menu in CSD windows. So maybe you want this - "close,maximize,minimize:menu,icon"?
Comment 4 Sergey Tereschenko 2015-10-30 18:52:40 UTC
Oh, yes, on the right!

And maybe i want "...:menu,icon"
But in this case CSD show "application menu with icon" and next to it just icon.


It would be nice to have something like "menu_or_icon" that displays menu button for CSD and icon for non-CSD.
Comment 5 Alberts Muktupāvels 2015-10-30 19:03:22 UTC
Created attachment 314517 [details] [review]
prefs: use Gtk/DecorationLayout only under GNOME-Flashback
Comment 6 Alberts Muktupāvels 2015-10-30 19:09:57 UTC
(In reply to Sergey Tereschenko from comment #4)
> Oh, yes, on the right!
> 
> And maybe i want "...:menu,icon"
> But in this case CSD show "application menu with icon" and next to it just
> icon.

Why do you want menu button? You can access it by right clicking on title bar...

> It would be nice to have something like "menu_or_icon" that displays menu
> button for CSD and icon for non-CSD.

There is no icon button for non-CSD...

I guess then you can do this:
1) org.gnome.gnome-flashback.workarounds fix-button-layout - set to empty string.
2) org.gnome.desktop.wm.preferences button-layout - set to "close,maximize,minimize:menu" (this is for non-CSD windows).
3) org.gnome.settings-daemon.plugins.xsettings overrides - set to {'Gtk/DecorationLayout': <'close,maximize,minimize:menu'>} (this is for CSD window).

Is that what you wanted?
Comment 7 Alberts Muktupāvels 2015-10-30 19:12:05 UTC
Oh, sorry, still there will be menu + icon in CSD windows... :(
Comment 8 Sergey Tereschenko 2015-10-30 19:44:10 UTC
Yes, i wanted that. But it works not quite as expected(

Setting Gtk/DecorationLayout overrides not only CSD but non-CSD too.

So, i leave it with default value.

Now, i set this:
> dconf write /org/gnome/gnome-flashback/workarounds/fix-button-layout "''"
> gsettings set org.gnome.desktop.wm.preferences button-layout "close,maximize,minimize:appmenu"

And i have "buttons:nothing" for non-CSD
And "buttons:appmenu" for CSD.

If i set org.gnome.desktop.wm.preferences to close,maximize,minimize:menu,
Then i have "buttons:menu" for non-CSD
And "buttons:nothing" for CSD.


For now i would use first variant. Thanks for help!