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 736974 - Too many buttons in client-side window decorations!
Too many buttons in client-side window decorations!
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: xsettings
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2014-09-19 14:03 UTC by Florian Müllner
Modified: 2014-09-19 19:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xsettings: Fix swapping out of WM settings schemas (3.10 KB, patch)
2014-09-19 14:03 UTC, Florian Müllner
none Details | Review
xsettings: Fix swapping out of WM settings schemas (3.96 KB, patch)
2014-09-19 14:04 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-09-19 14:03:19 UTC
Since bug 730629 we are supposed to sync the Gtk/DecorationLayout xsetting with the correct wm setting. Except that I'm stupid, so we occasionally end up using the classic schema in a normal session :-(

I'll attach two possible fixes, not quite sure which one I prefer ...
Comment 1 Florian Müllner 2014-09-19 14:03:27 UTC
Created attachment 286627 [details] [review]
xsettings: Fix swapping out of WM settings schemas

Until we get session-specific defaults in GSettings, we pick up the
button-layout setting from different schemas depending on whether we
are running in classic mode or not. However there is a serious thinko
in the current implementation: When running in classic mode, the
settings value is swapped with the one from the classic schema,
otherwise it is used directly - which turns out to be wrong when
the value itself is taken from the classic schema, e.g. during
initialization or when the classic value changed.
Fix this by ignoring the passed in value and picking the actual one
from the appropriate schema.
Comment 2 Florian Müllner 2014-09-19 14:04:06 UTC
Created attachment 286628 [details] [review]
xsettings: Fix swapping out of WM settings schemas

Until we get session-specific defaults in GSettings, we pick up the
button-layout setting from different schemas depending on whether we
are running in classic mode or not. However there is a serious thinko
in the current implementation: When running in classic mode, the
settings value is swapped with the one from the classic schema,
otherwise it is used directly - which turns out to be wrong when
the value itself is taken from the classic schema, e.g. during
initialization or when the classic value changed.
Avoid this confusion by not trying to add the classic schema unless
actually running in a classic session.
Comment 3 Ray Strode [halfline] 2014-09-19 14:37:53 UTC
Review of attachment 286628 [details] [review]:

looks right to me... I think i would mention in the commit message the problem is triggered by a spurious change event at start up.  freeze break?
Comment 4 Florian Müllner 2014-09-19 14:48:27 UTC
Comment on attachment 286627 [details] [review]
xsettings: Fix swapping out of WM settings schemas

(I auto-obsoleted the first alternative, but halfline figured it out anyway and reviewed the one he liked better)
Comment 5 Florian Müllner 2014-09-19 19:23:06 UTC
(In reply to comment #4)
> (I auto-obsoleted the first alternative, but halfline figured it out anyway and
> reviewed the one he liked better)

Small tidbit aside - while waiting for the freeze break, it occurred to me that I should check GTK+ as well (which does something similar on wayland) ... turns out that the code there already looks suspiciously like the first variant [0] :-)

[0] https://git.gnome.org/browse/gtk+/tree/gdk/wayland/gdkscreen-wayland.c#n726
Comment 6 Florian Müllner 2014-09-19 19:28:05 UTC
Attachment 286628 [details] pushed as a3e3513 - xsettings: Fix swapping out of WM settings schemas