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 746315 - Close button positioned incorrected in elementary w/ dual header bar
Close button positioned incorrected in elementary w/ dual header bar
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: client
master
Other Linux
: High normal
: ---
Assigned To: Geary Maintainers
Geary Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-16 22:56 UTC by Jim Nelson
Modified: 2015-03-20 20:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set the close button side correctly in GTK >= 3.12 (4.69 KB, patch)
2015-03-16 23:50 UTC, Robert Schroll
none Details | Review
Set the close button side correctly in GTK >= 3.12 (5.39 KB, patch)
2015-03-17 02:04 UTC, Robert Schroll
none Details | Review
Set the window decoration buttons correctly in GTK >= 3.12 (6.66 KB, patch)
2015-03-18 01:06 UTC, Robert Schroll
none Details | Review
Set the window decoration buttons correctly in GTK >= 3.12 (6.76 KB, patch)
2015-03-20 04:02 UTC, Robert Schroll
committed Details | Review

Description Jim Nelson 2015-03-16 22:56:11 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.
Comment 1 Robert Schroll 2015-03-16 23:26:42 UTC
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.
Comment 2 Jim Nelson 2015-03-16 23:30:40 UTC
If you give me a patch, I can test it.  I'm running Freya in a vbox machine.
Comment 3 Robert Schroll 2015-03-16 23:50:24 UTC
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.
Comment 4 Jim Nelson 2015-03-17 00:37:23 UTC
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.
Comment 5 Jim Nelson 2015-03-17 00:38:32 UTC
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.
Comment 6 Robert Schroll 2015-03-17 02:04:14 UTC
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.
Comment 7 Jim Nelson 2015-03-17 19:47:58 UTC
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.
Comment 8 Robert Schroll 2015-03-18 01:06:50 UTC
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.
Comment 9 Jim Nelson 2015-03-20 02:14:38 UTC
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.
Comment 10 Robert Schroll 2015-03-20 04:02:32 UTC
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.
Comment 11 Jim Nelson 2015-03-20 20:18:46 UTC
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!
Comment 12 Robert Schroll 2015-03-20 20:25:53 UTC
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