GNOME Bugzilla – Bug 740287
GtkWindow's hide-titlebar-when-maximized no longer does anything
Last modified: 2014-11-24 17:53:23 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.
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?
Ok, it totally works if I call show_all() before setting the property. So does that make this a gtk bug?
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.
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.
patch is currently untested since i don't have a new enough glib at the moment to build gtk+ master.
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.
attachment 291197 [details] [review] tests the patch. seems to work okay.
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