From 04883e72fa5eae8756710e46917d1c9058baf1f8 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 19 Jul 2015 04:44:17 +0200 Subject: [PATCH] window: Set the type hint when it changes, not just on map() There is no reason to wait until map() to reset a type hint on the GDK window. Just set it when it changes. --- gtk/gtkwindow.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 067d755422..c208f58d72 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -219,7 +219,6 @@ struct _GtkWindowPrivate guint focus_visible : 1; guint modal : 1; guint position : 3; - guint reset_type_hint : 1; guint resizable : 1; guint skips_pager : 1; guint skips_taskbar : 1; @@ -3501,6 +3500,7 @@ gtk_window_set_type_hint (GtkWindow *window, GdkWindowTypeHint hint) { GtkWindowPrivate *priv; + GdkWindow *gdk_window; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -3511,10 +3511,9 @@ gtk_window_set_type_hint (GtkWindow *window, priv->type_hint = hint; - if (gtk_widget_get_mapped (GTK_WIDGET (window))) - gdk_window_set_type_hint (gtk_widget_get_window (GTK_WIDGET (window)), hint); - else - priv->reset_type_hint = TRUE; + gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + if (gdk_window) + gdk_window_set_type_hint (gdk_window, hint); g_object_notify (G_OBJECT (window), "type-hint"); @@ -6116,17 +6115,6 @@ gtk_window_map (GtkWidget *widget) priv->need_default_size = FALSE; priv->need_default_position = FALSE; - if (priv->reset_type_hint) - { - /* We should only reset the type hint when the application - * used gtk_window_set_type_hint() to change the hint. - * Some applications use X directly to change the properties; - * in that case, we shouldn't overwrite what they did. - */ - gdk_window_set_type_hint (gdk_window, priv->type_hint); - priv->reset_type_hint = FALSE; - } - gdk_window_show (gdk_window); if (!disable_startup_notification &&