Re-realize the window if needed

When gtk_window_set_titlebar is called, we need to set up
client-side decorations properly, and the easiest way to do
so is to realize the window again. Really, you should call
set_titlebar before the window is realized.

https://bugzilla.gnome.org/show_bug.cgi?id=722919
This commit is contained in:
Matthias Clasen
2014-01-24 14:32:00 -05:00
parent a8d72a9c1e
commit 365902cd58

View File

@@ -3682,9 +3682,14 @@ gtk_window_set_titlebar (GtkWindow *window,
GtkWidget *widget = GTK_WIDGET (window);
GtkWindowPrivate *priv = window->priv;
GdkVisual *visual;
gboolean was_mapped;
g_return_if_fail (GTK_IS_WINDOW (window));
was_mapped = gtk_widget_get_mapped (widget);
if (gtk_widget_get_realized (widget))
gtk_widget_unrealize (widget);
unset_titlebar (window);
if (titlebar == NULL)
@@ -3715,7 +3720,8 @@ gtk_window_set_titlebar (GtkWindow *window,
gtk_style_context_add_class (gtk_widget_get_style_context (titlebar),
GTK_STYLE_CLASS_TITLEBAR);
gtk_widget_queue_resize (widget);
if (was_mapped)
gtk_widget_map (widget);
}
gboolean