[gtk+] stack: Update windows before allocating children



commit 373ce9f6528e095ca388ee374690492266b87222
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 30 10:35:04 2015 -0500

    stack: Update windows before allocating children
    
    Doing things the other way around seems to cause problems in
    some cases where children want to do different things depending
    on the window position.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758563

 gtk/gtkstack.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index bc9e347..09ee656 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2183,6 +2183,16 @@ gtk_stack_size_allocate (GtkWidget     *widget,
 
   gtk_widget_set_allocation (widget, allocation);
 
+  if (gtk_widget_get_realized (widget))
+    {
+      gdk_window_move_resize (priv->view_window,
+                              allocation->x, allocation->y,
+                              allocation->width, allocation->height);
+      gdk_window_move_resize (priv->bin_window,
+                              get_bin_window_x (stack, allocation), get_bin_window_y (stack, allocation),
+                              allocation->width, allocation->height);
+    }
+
   child_allocation.x = 0;
   child_allocation.y = 0;
   child_allocation.width = allocation->width;
@@ -2218,16 +2228,6 @@ gtk_stack_size_allocate (GtkWidget     *widget,
           gtk_widget_size_allocate (priv->visible_child->widget, &child_allocation);
         }
     }
-
-   if (gtk_widget_get_realized (widget))
-    {
-      gdk_window_move_resize (priv->view_window,
-                              allocation->x, allocation->y,
-                              allocation->width, allocation->height);
-      gdk_window_move_resize (priv->bin_window,
-                              get_bin_window_x (stack, allocation), get_bin_window_y (stack, allocation),
-                              allocation->width, allocation->height);
-    }
 }
 
 


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