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 730629 - minimise and maximise buttons not present in header bars in gnome classic
minimise and maximise buttons not present in header bars in gnome classic
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: xsettings
3.12.x
Other Linux
: Normal minor
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on: 730752
Blocks: 731273
 
 
Reported: 2014-05-23 10:38 UTC by yefexe7584
Modified: 2014-06-06 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
prefs: Sync button-layout setting with GSD's XSettings plugin (5.00 KB, patch)
2014-05-26 09:39 UTC, Florian Müllner
none Details | Review
xsettings: Set Gtk/DecorationLayout from wm preferences (11.15 KB, patch)
2014-06-05 13:01 UTC, Florian Müllner
committed Details | Review
xsettings: Explicitly handle classic mode for now (4.68 KB, patch)
2014-06-05 13:02 UTC, Florian Müllner
committed Details | Review

Description yefexe7584 2014-05-23 10:38:43 UTC
In GNOME 3.12 maximise and minimize buttons can available in the new headers bars that are present in some applications such as Nautilus. They can be turned enabled by setting maximise and minimise to "On" in the "Window" section of the gnome-tweak-tool. 

However, in the GNOME Classic session the maximise and minimise buttons are not present in applications with header bars even though the maximise and minimize options are set to "On" in the gnome-tweak-tool.

Can anyone else confirm this? I'm using GNOME 3.12.2 on Arch Linux 64 bit.
Comment 1 yefexe7584 2014-05-23 10:40:18 UTC
Sorry, first sentence should say: In GNOME 3.12, maximise and minimize buttons are available in the new header
bars that are present in some applications such as Nautilus.
Comment 2 Florian Müllner 2014-05-23 10:46:10 UTC
Yes, that's a known problem. The problem is basically that the preference overrides in gnome-shell won't work for CSD decorations. Part of the solution would probably be in dconf/gio, but assigning to gtk+ for now which does the decorations in this case.
Comment 3 Matthias Clasen 2014-05-23 10:59:13 UTC
Florian, when I asked Ryan about desktop-dependend defaults, he didn't seem to have any concrete plans. Can we work out another solution ?

I don't think GTK+ will be involved here, either way. We provide a gtksetting/xsetting; it is up to the environment to make it have the right value...
Comment 4 Florian Müllner 2014-05-23 13:51:32 UTC
(In reply to comment #3)
> Florian, when I asked Ryan about desktop-dependend defaults, he didn't seem to
> have any concrete plans. Can we work out another solution ?

Yeah. I think we can make this quite straight-forward actually, I'll attach a patch in a bit.
Comment 5 Florian Müllner 2014-05-26 09:39:42 UTC
Created attachment 277190 [details] [review]
prefs: Sync button-layout setting with GSD's XSettings plugin

GTK+'s client-side decorations follow an XSetting to determine
which standard window buttons to show, similar to our own
button-layout setting in org.gnome.desktop.wm.preferences.
Keeping both mechanisms completely separate obviously means we
can end up with unwanted inconsistency, so we should link them.

Off-hand we have the following options:
 (1) Stop using our own setting and switch to XSettings instead
     (via GtkSettings:gtk-decoration-layout); this would fix
     the inconsistency, but break different defaults for normal
     and classic session
 (2) Sync our setting to gnome-settings-daemon's xsettings plugin's
     override key; this breaks the GSD key as a user setting,
     which might be undesirable for non-GNOME users of GSD
 (3) Invent yet-another-private-protocol between mutter/gnome-shell
     and gnome-settings-daemon for getting the default XSettings
     value from the WM before applying the override key; no
     downside apart from the added complexity as far as I can see

Provided that (2) works just fine for GNOME, let's go with that
for now - we can always reconsider (3) when third parties run
into actual problems with this.
Comment 6 Jasper St. Pierre (not reading bugmail) 2014-05-26 12:15:41 UTC
Two things I don't like about this approach. First, Ryan doesn't like system components calling g_settings_set_* on system startup, which we would do whenever you switch to Classic, or back to Normal, if I understand it correctly.

Second, XSettings won't exist on Wayland. What do we do there?

I feel like with the new profiles stuff Ryan is working on for dconf, we should be able to have different defaults for the different sessions in a more natural way than our current overrides system.
Comment 7 Florian Müllner 2014-05-26 12:29:40 UTC
(In reply to comment #6)
> I feel like with the new profiles stuff Ryan is working on for dconf, we should
> be able to have different defaults for the different sessions in a more natural
> way than our current overrides system.

Quoting comment #3:
"when I asked Ryan about desktop-dependend defaults, he didn't seem to
have any concrete plans"

So yes, I'm all for replacing our overrides system with session-dependent defaults once we get them, but it doesn't look like that's in the near future just yet ...
Comment 8 Florian Müllner 2014-06-05 12:59:19 UTC
(In reply to comment #7)
> Quoting comment #3:
> "when I asked Ryan about desktop-dependend defaults, he didn't seem to
> have any concrete plans"
> 
> So yes, I'm all for replacing our overrides system with session-dependent
> defaults once we get them, but it doesn't look like that's in the near future
> just yet ...

I've talked with Ryan myself now, and while there are still a lot of unshaven yaks, work is underway.

So I'd say we can add code to both gnome-settings-daemon (X) and gtk+ (wayland) to
  (1) use the button-layout setting in org.gnome.desktop.wm.preferences to set
      the default gtk_decoration_layout
  (2) swap out the schema with org.gnome.shell.extensions.classic-overrides
      when XDG_CURRENT_DESKTOP indicates a classic session

(2) is pretty ugly, but acceptable as a temporary workaround in my opinion - it would be reverted as soon as we get proper XDG_CURRENT_DESKTOP-dependent defaults.
Comment 9 Florian Müllner 2014-06-05 13:01:55 UTC
Created attachment 277949 [details] [review]
xsettings: Set Gtk/DecorationLayout from wm preferences

GTK+'s client-side decorations follow an XSetting to determine
which standard window buttons to show, similar to mutter's
button-layout setting in org.gnome.desktop.wm.preferences.
Keeping both mechanisms completely separate obviously means we
can end up with unwanted inconsistency, so use the GSetting
to back the XSetting on GNOME, just like we already do for
other settings (though it's a bit more involved, as the
possible values differ between mutter and GTK+).
Comment 10 Florian Müllner 2014-06-05 13:02:02 UTC
Created attachment 277950 [details] [review]
xsettings: Explicitly handle classic mode for now

There are plans to add session-dependent defaults to GSettings
(based on the newly standardized XDG_CURRENT_DESKTOP); until
then, the WM uses a different schema for its button-layout
setting in classic mode. So for the time being, do the same
and pick the alternative schema when XDG_CURRENT_DESKTOP
indicates that we are in a classic session.
(It's not pretty, but hopefully won't be with us for too long ...)
Comment 11 Bastien Nocera 2014-06-06 12:19:37 UTC
Review of attachment 277949 [details] [review]:

Rest looks fine.

::: plugins/xsettings/Makefile.am
@@ +28,3 @@
 	$(AM_CPPFLAGS)
 
+noinst_PROGRAMS += test-wm-button-layout-translations

I'd rather you made a separate test-wm-button-layout-translations.c
Comment 12 Bastien Nocera 2014-06-06 12:21:36 UTC
Review of attachment 277950 [details] [review]:

Looks good.
Comment 13 Florian Müllner 2014-06-06 13:41:46 UTC
Attachment 277949 [details] pushed as dc5619f - xsettings: Set Gtk/DecorationLayout from wm preferences
Attachment 277950 [details] pushed as 1eb4544 - xsettings: Explicitly handle classic mode for now

Moved test to a separate file (the main idea here was that wm-button-layout-translation.[ch] are shared with gdk's wayland backend, and that keeping the number copy-pasted files down is a good thing - but then I didn't even bother to enable the test on the gtk side anyway ...)