[gtk/wip/otte/for-master: 1/11] window: present() the toplevel only once




commit 67a604daea6daf7fd79f67a316845fa9f9aa9be3
Author: Benjamin Otte <otte redhat com>
Date:   Tue Mar 16 01:53:37 2021 +0100

    window: present() the toplevel only once
    
    It needs to be done before mapping the children so that the toplevel is
    visible when the children want to show popovers.

 gtk/gtkwindow.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 2aa6053494..221888ad1f 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -437,7 +437,6 @@ static void        gtk_window_css_changed               (GtkWidget      *widget,
                                                          GtkCssStyleChange *change);
 static void _gtk_window_set_is_active (GtkWindow *window,
                                       gboolean   is_active);
-static void gtk_window_present_toplevel (GtkWindow *window);
 static void gtk_window_update_toplevel (GtkWindow         *window,
                                         GdkToplevelLayout *layout);
 
@@ -3800,8 +3799,6 @@ gtk_window_show (GtkWidget *widget)
 
   gtk_widget_realize (widget);
 
-  gtk_window_present_toplevel (window);
-
   gtk_widget_map (widget);
 
   if (!priv->focus_widget)
@@ -3869,6 +3866,8 @@ gtk_window_map (GtkWidget *widget)
   GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
   GtkWidget *child = priv->child;
 
+  gtk_window_present_toplevel (window);
+
   GTK_WIDGET_CLASS (gtk_window_parent_class)->map (widget);
 
   if (child != NULL && gtk_widget_get_visible (child))
@@ -3879,8 +3878,6 @@ gtk_window_map (GtkWidget *widget)
       gtk_widget_get_child_visible (priv->title_box))
     gtk_widget_map (priv->title_box);
 
-  gtk_window_present_toplevel (window);
-
   if (priv->minimize_initially)
     gdk_toplevel_minimize (GDK_TOPLEVEL (priv->surface));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]