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 745381 - Close button hidden by side panel when window controls are left aligned.
Close button hidden by side panel when window controls are left aligned.
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-01 19:06 UTC by Evan Welsh
Modified: 2018-01-24 20:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Enables GEdit's left panel to show, if needed, the close button (1.45 KB, patch)
2015-10-09 21:03 UTC, raster
none Details | Review
Enables GEdit's left panel to show, if needed, the close button. Fixed variable name. (1.46 KB, patch)
2015-10-10 17:45 UTC, raster
none Details | Review
Enables GEdit's left panel to show, if needed, the close button. Only UI changes. (817 bytes, patch)
2015-10-13 13:00 UTC, raster
none Details | Review
Enables GEdit's left panel to show, if needed, the close button. Only UI changes, patch fixed (642 bytes, patch)
2015-11-24 16:40 UTC, raster
none Details | Review
Enables GEdit's left panel to show, if needed, the close button. Only UI changes, patch adapted to git format. (684 bytes, patch)
2015-11-24 17:34 UTC, raster
none Details | Review
Enables GEdit's left panel to show, if needed, the close button. Only UI changes, patch now REALLY in git format. (1.03 KB, patch)
2015-11-24 17:42 UTC, raster
none Details | Review
Patch that follows the git conventions (2.33 KB, patch)
2016-05-15 00:44 UTC, raster
committed Details | Review

Description Evan Welsh 2015-03-01 19:06:18 UTC
When you set 'org.gnome.settings-daemon.plugins.xsettings overrides' to left aligned window controls gedit's close button is not longer accessible.
Comment 1 Sébastien Wilmet 2015-03-09 12:24:44 UTC
Can you provide the complete gsettings command so we can test this bug more quickly?
Comment 2 raster 2015-05-08 23:01:46 UTC
I'm not the original reporter, but I have the same problem. I set with dconf-editor:

    org.gnome.desktop.wm.button-layout

to:

    close:appmenu

When doing that, the close button is shown left aligned (but warning: if you change it, you must restart your session in order to some GTK3 apps to apply the change). In Gedit, by default, it is also shown at left, but when enabling the left panel, the close button is hidden.
Comment 3 David Greengas 2015-07-15 17:36:59 UTC
I can also confirm the same behavior.

output of gsettings get org.gnome.desktop.wm.preferences button-layout
'close:appmenu'
Comment 4 raster 2015-10-09 21:03:05 UTC
Created attachment 312983 [details] [review]
Enables GEdit's left panel to show, if needed, the close button
Comment 5 Ignacio Casal Quinteiro (nacho) 2015-10-10 11:35:08 UTC
Review of attachment 312983 [details] [review]:

See the comment inline. Also I have some questions about this patch since I did not look at the code. Why is the close button set to true by default on the side bar? I would expect it to be true just when using the left buttons...

::: gedit/gedit-window.c
@@ +2374,2 @@
 			layout_headerbar = g_strdup_printf ("%c%s", ':', tokens[1]);
+			layout_headerbar2 = g_strdup_printf ("%s%c",  tokens[0], ':');

let's call it layout_side_headerbar to be consistent with the other variable
Comment 6 raster 2015-10-10 17:44:29 UTC
Hi:

Here is the new patch with the variable name changed.

About your question: the "show-close-button" property only determines whether the window decorations are shown or not, but not which ones. That is determined by the decoration layout. Here are more details:

https://developer.gnome.org/gtk3/stable/GtkHeaderBar.html#GtkHeaderBar--show-close-button

Gedit creates two header bars, and put one (headerbar) in the main part of the main window, and the other one (side_headerbar) in the left panel. The current code in Gedit knows when the left panel is hiden (in which case it will set the full layout in headerbar) or visible (in which case it will cut the layout in two halves, one with the left decorations, which will be assigned to side_headerbar, and another with the right decorations, assigned to headerbar).

Unfortunately this doesn't work fine because the UI file forgets to enable show-close-button in side_headerbar, and that's why the close button isn't show at the left, but is shown at the right (headerbar has show-close-button enabled).

The code modifications in gedit-window.c aren't really needed (the patch works without them) but they make this trick more strict, by ensuring that both layouts contains the colon used as separator.
Comment 7 raster 2015-10-10 17:45:52 UTC
Created attachment 313025 [details] [review]
Enables GEdit's left panel to show, if needed, the close button. Fixed variable name.
Comment 8 raster 2015-10-10 17:51:14 UTC
If you prefer, I can remove the changes in gedit-window.c and keep only the ones in gedit-window.ui, which are the only really needed to fix the bug.
Comment 9 raster 2015-10-11 09:40:21 UTC
I closed the pull request in the github account. I think it's better to stay with this one only.
Comment 10 raster 2015-10-11 09:44:20 UTC
BTW: maybe the right way to go, for future cases, is to add to GtkHeaderBar two boolean properties (by default set to TRUE), that specifies whether that header bar should show the left layout, the right layout, both, or none.
Comment 11 raster 2015-10-13 13:00:36 UTC
Created attachment 313182 [details] [review]
Enables GEdit's left panel to show, if needed, the close button. Only UI changes.

Enables GEdit's left panel to show, if needed, the close button. This patch contains only the minimal changes needed to make it work, which is to enable "show_close_button" property in the side_headerbar, and doesn't contain the changes in the code to make it more strict.

Use this patch instead of the old one if you consider that the code changes should not be added.
Comment 12 Ignacio Casal Quinteiro (nacho) 2015-11-24 11:16:46 UTC
Review of attachment 313025 [details] [review]:

See the comment.

::: gedit/resources/ui/gedit-window.ui
@@ +17,3 @@
             <property name="visible" bind-source="side_panel" bind-property="visible" bind-flags="sync-create"/>
             <property name="title" translatable="yes">Documents</property>
+            <property name="show_close_button">True</property>

why is this set to true here?
Comment 13 Ignacio Casal Quinteiro (nacho) 2015-11-24 11:17:39 UTC
Review of attachment 313182 [details] [review]:

I do not like this patch. That property I guess should be set programmatically? Also you are modifying the submodule by mistake
Comment 14 raster 2015-11-24 11:44:42 UTC
That property is also set in the .ui file for the other panel, that's why I put that there.

Here is the code for the other side bar, the main one:

          <object class="GtkHeaderBar" id="headerbar">
            <property name="visible">True</property>
            <property name="show_close_button">True</property>
            <style>
              <class name="titlebar"/>
            </style>
            <child>


What do you mean with "modifying the submodule by mistake"?
Comment 15 Sebastien Bacher 2015-11-24 16:24:04 UTC
> What do you mean with "modifying the submodule by mistake"?

the patch has this change

"--- a/libgd	
+++ a/libgd	
@@ -1, +0,0 @@ 
-Subproject commit 5ee5a6e576626ff76f1204392faf78751496ff84
"

that's wrong
Comment 16 raster 2015-11-24 16:35:17 UTC
Yes, that's wrong... I don't know why it has that...
Comment 17 raster 2015-11-24 16:40:06 UTC
Created attachment 316184 [details] [review]
Enables GEdit's left panel to show, if needed, the close button. Only UI changes, patch fixed

Removed the part about libgd, which should not be there.
Comment 18 raster 2015-11-24 16:40:22 UTC
Fixed the patch.
Comment 19 Sebastien Bacher 2015-11-24 16:41:23 UTC
Could you fix it and maybe use git format-patch to attach the updated one (https://wiki.gnome.org/Git/Developers#Contributing_patches)?
Comment 20 Sebastien Bacher 2015-11-24 17:06:32 UTC
note also that the "documents" button is not properly centered when decorations are displayed on the left, but that's probably a different issue
Comment 21 raster 2015-11-24 17:34:32 UTC
Created attachment 316187 [details] [review]
Enables GEdit's left panel to show, if needed, the close button. Only UI changes, patch adapted to git format.

The commit 2e799694043c232bafda0fb1e2272458a66e6995 (16 oct. 2015) added the "show_close_button" and set it to false. That's why this patch now replaces the line, instead of just adding it like in old patches.
Comment 22 raster 2015-11-24 17:35:56 UTC
The "documents" button is centered between the close button and the container border. To fix that I suspect a change in GTK must be done...
Comment 23 raster 2015-11-24 17:42:33 UTC
Created attachment 316188 [details] [review]
Enables GEdit's left panel to show, if needed, the close button. Only UI changes, patch now REALLY in git format.

Used "format-patch" instead of "diff".
Comment 24 Michael Catanzaro 2016-02-21 03:15:51 UTC
Review of attachment 316188 [details] [review]:

LGTM, maintainers?

Tweak Tool likely has this problem as well, did you check?
Comment 25 Paolo Borelli 2016-02-21 14:43:57 UTC
Review of attachment 316188 [details] [review]:

I did not test this, but it does not look correct to me: I expect that changing from False to True will fix one case and break the other.
My guess is that we need to add code that detects the current setup and sets that property accordingly.

Or am I missing something?

Also, please make sure to follow the git conventions for the commit message (one short subject line of max 72 chars, one empty line, and then the full description)
Comment 26 raster 2016-02-21 18:46:22 UTC
Paolo Borelli: the code is already in GEdit, but, due to some mistake, the programmer forgot to add this "True". It doesn't break anything, it just makes it work.

Michale Catanzaro: if you are talking about "Gnome Tweak Tool", it works fine with close button at the left...
Comment 27 raster 2016-04-24 18:15:37 UTC
So... will this patch be added in Gedit 3.20.2? Maybe in Gedit 3.22.0?
Comment 28 raster 2016-05-15 00:44:49 UTC
Created attachment 327906 [details] [review]
Patch that follows the git conventions

Ok, I think now the patch follows the git conventions. Please, try it. You will see that it works fine.
Comment 29 Alexander Mikhaylenko 2017-05-17 15:16:45 UTC
It's been a year since the last version of the patch. Has everyone forgotten about it?
Comment 30 raster 2017-05-17 19:40:41 UTC
It seems that this has been forgotten. But until they remember, you can try an extension I wrote to fix this. You can download it from my homepage:

http://www.rastersoft.com/programas/gedit_closebutton.html
Comment 31 Alexander Mikhaylenko 2017-05-17 19:42:25 UTC
I have close button on the right, so I don't really need it. Maybe it would be a good idea to ask gedit maintainer directly?
Comment 32 Evan Welsh 2017-05-17 22:01:25 UTC
Sorry, I originally reported this but somehow lost track. This bug still makes it difficult to close gedit windows on left-aligned systems.
Comment 33 Jeremy Bicha 2018-01-24 20:52:52 UTC
Sergio, thank you for submitting this patch. I have gone ahead and pushed this to gedit master now. Ubuntu has included this patch for the past year and a half without a problem. I apologize that it did not get applied sooner. gedit is undermaintained right now so it's more likely that patches will not be seen promptly.

https://git.gnome.org/browse/gedit/commit/?id=2d7369a01
Comment 34 Jeremy Bicha 2018-01-24 20:53:18 UTC
Review of attachment 327906 [details] [review]:

.