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 740287 - GtkWindow's hide-titlebar-when-maximized no longer does anything
GtkWindow's hide-titlebar-when-maximized no longer does anything
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-11-17 21:31 UTC by David Shea
Modified: 2014-11-24 17:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: fix gtk_window_set_hide_titlebar_when_maximized when called before realize (4.33 KB, patch)
2014-11-20 22:21 UTC, Ray Strode [halfline]
none Details | Review
testsuite: add hide-titlebar-when-maximized test for GtkWindow (4.53 KB, patch)
2014-11-21 19:24 UTC, Ray Strode [halfline]
committed Details | Review

Description David Shea 2014-11-17 21:31:41 UTC
I have no clue if this is the right component for this, so, apologies.

Setting hide-titlebar-when-maximized used to work in gnome-shell in Fedora 20 (gnome-shell-3.10.2.1). In Fedora 21 (gnome-shell-3.14.1.5) it does not appear to do anything.
Comment 1 Ray Strode [halfline] 2014-11-17 22:13:32 UTC
works here with this test case:

from gi.repository import Gtk
w = Gtk.Window()
w.show_all()
w.set_hide_titlebar_when_maximized(True)
Gtk.main()

$ rpm -q gtk3 mutter gnome-shell
gtk3-3.14.5-1.fc21.x86_64
mutter-3.14.2-1.fc21.x86_64
gnome-shell-3.14.2-1.fc21.x86_64

Is the window realized / shown in your code?
Comment 2 David Shea 2014-11-17 22:17:42 UTC
Ok, it totally works if I call show_all() before setting the property. So does that make this a gtk bug?
Comment 3 Ray Strode [halfline] 2014-11-17 22:22:50 UTC
yea. looks like it was introduced here:

https://git.gnome.org/browse/gtk+/commit/?id=510c2cdfb6362568f4384790dc06e0b1b4aba0e5

gtk_window_set_hide_titlebar_when_maximized is called again on your behalf when the window is mapped, but that commit made the implicit call become a noop.
Comment 4 Ray Strode [halfline] 2014-11-20 22:21:48 UTC
Created attachment 291131 [details] [review]
window: fix gtk_window_set_hide_titlebar_when_maximized when called before realize

Since commit 510c2cdfb6362568f4384790dc06e0b1b4aba0e5 applications that
set hide-titlebar-when-maximized before showing their windows no longer
get their titlebars hidden when maximized.

This is because that commit made gtk_window_set_hide_titlebar_when_maximized
return early if the property was already set, but the function
intentionally sets the property even when it can't be applied
right away with the expectation it will get applied later in
gtk_window_map (by recalling gtk_window_set_hide_titlebar_when_maximized
with the value of the property).

This commit ensures that the X property is always set or cleared on the X
window, as appropriate, if there's an X window available.
Comment 5 Ray Strode [halfline] 2014-11-20 22:22:21 UTC
patch is currently untested since i don't have a new enough glib at the moment to build gtk+ master.
Comment 6 Ray Strode [halfline] 2014-11-21 19:24:18 UTC
Created attachment 291197 [details] [review]
testsuite: add hide-titlebar-when-maximized test for GtkWindow

This commit adds a test that checks whether or not
hide-titlebar-when-maximized can be set before the window is
realized.
Comment 7 Ray Strode [halfline] 2014-11-21 19:24:51 UTC
attachment 291197 [details] [review] tests the patch. seems to work okay.
Comment 8 Matthias Clasen 2014-11-24 17:53:23 UTC
Comment on attachment 291197 [details] [review]
testsuite: add hide-titlebar-when-maximized test for GtkWindow

Attachment 291197 [details] pushed as 3a5d153 - testsuite: add hide-titlebar-when-maximized test for GtkWindow