[gtk+/gtk-3-22] gtkstack: reorder size_allocate and move_window
- From: Olivier Fourdan <ofourdan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] gtkstack: reorder size_allocate and move_window
- Date: Mon, 14 Nov 2016 11:13:06 +0000 (UTC)
commit 57f551a114fdcccbf04940067e2b862e753f56a6
Author: Olivier Fourdan <ofourdan redhat com>
Date: Wed Nov 2 10:08:17 2016 +0100
gtkstack: reorder size_allocate and move_window
Unlike other container widgets, GtkStack would allocate its children
prior to moving its windows, which might prevent further valid size
allocation signals to be emitted.
Re-order the size allocation of child widgets to be performed after
moving the GtkStack windows.
Thanks to Owen for spotting the real issue here.
https://bugzilla.gnome.org/show_bug.cgi?id=767713
gtk/gtkstack.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 22e19a6..6ef9206 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2245,6 +2245,15 @@ gtk_stack_allocate (GtkCssGadget *gadget,
child_allocation.x = 0;
child_allocation.y = 0;
+ 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);
+ }
if (priv->last_visible_child)
{
@@ -2284,17 +2293,6 @@ gtk_stack_allocate (GtkCssGadget *gadget,
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);
- }
-
gtk_container_get_children_clip (GTK_CONTAINER (widget), out_clip);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]