Keep gtk_window_set_hide_titlebar_when_maximized working

This broke in 510c2cdfb6.

https://bugzilla.gnome.org/show_bug.cgi?id=740287
This commit is contained in:
Matthias Clasen 2014-11-24 06:49:19 -05:00
parent 8d6d73e8d9
commit c7f3b93d99

View File

@ -3716,6 +3716,21 @@ gtk_window_get_destroy_with_parent (GtkWindow *window)
return window->priv->destroy_with_parent;
}
static void
gtk_window_apply_hide_titlebar_when_maximized (GtkWindow *window)
{
#ifdef GDK_WINDOWING_X11
GdkWindow *gdk_window;
gboolean setting;
setting = window->priv->hide_titlebar_when_maximized;
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
if (GDK_IS_X11_WINDOW (gdk_window))
gdk_x11_window_set_hide_titlebar_when_maximized (gdk_window, setting);
#endif
}
/**
* gtk_window_set_hide_titlebar_when_maximized:
* @window: a #GtkWindow
@ -3743,18 +3758,9 @@ gtk_window_set_hide_titlebar_when_maximized (GtkWindow *window,
if (window->priv->hide_titlebar_when_maximized == setting)
return;
#ifdef GDK_WINDOWING_X11
{
GdkWindow *gdk_window;
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
if (GDK_IS_X11_WINDOW (gdk_window))
gdk_x11_window_set_hide_titlebar_when_maximized (gdk_window, setting);
}
#endif
window->priv->hide_titlebar_when_maximized = setting;
gtk_window_apply_hide_titlebar_when_maximized (window);
g_object_notify (G_OBJECT (window), "hide-titlebar-when-maximized");
}
@ -5972,8 +5978,7 @@ gtk_window_map (GtkWidget *widget)
if (priv->type == GTK_WINDOW_TOPLEVEL)
{
gtk_window_set_theme_variant (window);
gtk_window_set_hide_titlebar_when_maximized (window,
priv->hide_titlebar_when_maximized);
gtk_window_apply_hide_titlebar_when_maximized (window);
}
/* No longer use the default settings */