widget: Allow invisible toplevels to do sizing operations

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.
This commit is contained in:
Benjamin Otte 2013-01-24 14:25:27 +01:00
parent 78d91aaf9b
commit 154204e891
2 changed files with 2 additions and 2 deletions

View 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;

View 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);