GNOME Bugzilla – Bug 746315
Close button positioned incorrected in elementary w/ dual header bar
Last modified: 2015-03-20 20:25:56 UTC
Looking at Geary master in the elementary Freya beta, the window close button is located at the far left of the right-hand header bar. The other elements (including the gear button, which we display because elementary doesn't offer an app menu) are displayed in the correct positions.
In 3.10, the button side was set by the "decoration-button-layout" style property of to the toplevel window. It appears that in 3.12, it is set by the "decorate-layout" property of the headerbar. Because backwards compatibility is for losers! I expect that we're testing the old mechanism and deciding that the close button goes on the right, while GTK is testing the new mechanism ad deciding it goes on the left, so it gets put on the left side of the right headerbar. We should be able to fix this up with some conditional code. I can do this, but I can't test it.
If you give me a patch, I can test it. I'm running Freya in a vbox machine.
Created attachment 299558 [details] [review] Set the close button side correctly in GTK >= 3.12 I'm guessing the detach button is also shown on the wrong side. (It's supposed to follow the close button.) This should fix both. It's ugly. Once we drop 3.10 support, we can probably develop a much cleaner system based entirely on properties.
One issue: There's a typo in the patch, "set_detach_button_size" rather than "set_detach_button_side". So, this works in one sense: the close button moves to the left side of the left-hand toolbar (which is where it belongs on elementary). However, now the maximize button (which all elementary apps feature on the far right-side of the toolbar, to the right of the gear menu) is on the right side of the left-hand headerbar in Geary.
Also, the detach button w/ this patch is on the left side of the right-hand toolbar, so it moved as you thought it would.
Created attachment 299563 [details] [review] Set the close button side correctly in GTK >= 3.12 This may work. But then again, it may not. It's supposed to read the default header layout and apply the left half to the left headerbar and the right half to the right. Dunno if it'll work, though.
Unfortunately, in this iteration the close button and the maximize button are missing entirely. I don't see any warnings in the debug log indicating why. Unfortunately, this is important because elementary has standardized on Geary (the only distro to do so to date). Is it possible for you to download the Freya beta and run it on VirtualBox? That would speed up this process. You might also contact the elementary folks on IRC or something; they might know exactly where to look for the information you need.
Created attachment 299669 [details] [review] Set the window decoration buttons correctly in GTK >= 3.12 This seems to work. It turns out both the decorations setting and the show_close_button property affect the display of these buttons. We also need to adjust the composer header when it's replacing the converation header.
Review of attachment 299669 [details] [review]: Please test against Unity (if you've not already). If it's good, commit! Thanks for working through this, I know it was a bear.
Created attachment 299907 [details] [review] Set the window decoration buttons correctly in GTK >= 3.12 I don't have a GTK 3.12 version of Unity hanging around, but I faked it in elementary by forcing the is_running_unity property to be true. And found a problem -- I was showing the window decorations twice. This should fix it.
Review of attachment 299907 [details] [review]: Ok, I tried this out on elementary, Trusty, Utopic, Vivid, and F21, and it checks out on all. Commit!
For once, I'm looking forward to upping our GTK requirement, so we can clear out a lot of this cruft. Attachment 299907 [details] pushed as 30500a7 - Set the window decoration buttons correctly in GTK >= 3.12