[gtk+] widget: Allow invisible toplevels to do sizing operations
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Allow invisible toplevels to do sizing operations
- Date: Thu, 24 Jan 2013 13:29:40 +0000 (UTC)
commit 154204e89136f338a3b0cbd91ddaebc09e4bd8e3
Author: Benjamin Otte <otte redhat com>
Date: Thu Jan 24 14:25:27 2013 +0100
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.
gtk/gtksizerequest.c | 2 +-
gtk/gtkwidget.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 4d54821..0ce86bd 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -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;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index ed584ea..585b4f8 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]