]> Pileus Git - ~andy/gtk/commitdiff
widget: Allow invisible toplevels to do sizing operations
authorBenjamin Otte <otte@redhat.com>
Thu, 24 Jan 2013 13:25:27 +0000 (14:25 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 24 Jan 2013 13:28:58 +0000 (14:28 +0100)
This is a quickfix to keep things working.

It turns out GtkWindow assumes it can do sizing operations while not
being visible, or while in the process of show()ing/hide()ing itself.
And commit b495ce54 broke these operations.

Figuring this properly requires some more thinking and restructuring on
my part, so for now we relax the requirement of visiblility enough for
these things to start working again.

gtk/gtksizerequest.c
gtk/gtkwidget.c

index 4d54821c0e96242bf047164e176738fc619462ae..0ce86bd66fc95b849c98347619791f28898604b8 100644 (file)
@@ -268,7 +268,7 @@ _gtk_widget_compute_size_for_orientation (GtkWidget        *widget,
   gpointer key;
   gint    min_result = 0, nat_result = 0;
 
-  if (!gtk_widget_get_visible (widget))
+  if (!gtk_widget_get_visible (widget) && !gtk_widget_is_toplevel (widget))
     {
       if (minimum)
         *minimum = 0;
index ed584eafaac42a2e8531314c0c9a4fdb0d5a4fd5..585b4f873efb6d254387f25249ae53c69214dc6c 100644 (file)
@@ -4817,7 +4817,7 @@ gtk_widget_size_allocate (GtkWidget       *widget,
 
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (!priv->visible)
+  if (!priv->visible && !gtk_widget_is_toplevel (widget))
     return;
 
   gtk_widget_push_verify_invariants (widget);