diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-11-20 17:11:44 +0100 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2020-12-07 09:46:39 +0100 |
commit | 996eeec16cd3923a1f50c7aafbb68e81cd108c3c (patch) | |
tree | 3f649e24bfce2f1ee12d9468359d0774a3ed47ef /gtk/gtkwindow.c | |
parent | 641915974be5113ab3bb16e1b5aa0be274d66608 (diff) | |
download | gtk+-996eeec16cd3923a1f50c7aafbb68e81cd108c3c.tar.gz |
gtk/window: Don't gdk_toplevel_present() if not mapped
That would map the window too early.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 996e09c64b..e1d83addbd 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -3856,7 +3856,8 @@ gtk_window_update_toplevel (GtkWindow *window) g_clear_pointer (&priv->layout, gdk_toplevel_layout_unref); priv->layout = gtk_window_compute_layout (window); - gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), priv->layout); + if (_gtk_widget_get_mapped (GTK_WIDGET (window))) + gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), priv->layout); } } @@ -5660,7 +5661,8 @@ gtk_window_move_resize (GtkWindow *window) if (configure_request_pos_changed) g_warning ("configure request position changed. This should not happen. Ignoring the position"); - gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), priv->layout); + if (_gtk_widget_get_mapped (widget)) + gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), priv->layout); } else { @@ -5869,8 +5871,6 @@ gtk_window_present_with_time (GtkWindow *window, g_assert (surface != NULL); - gtk_window_present_toplevel (window); - /* Translate a timestamp of GDK_CURRENT_TIME appropriately */ if (timestamp == GDK_CURRENT_TIME) { |