diff options
author | Owen Taylor <otaylor@gtk.org> | 1998-05-12 01:02:22 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-05-12 01:02:22 +0000 |
commit | 962386fb82c0c9d040a0c92a851692c41f21f5bc (patch) | |
tree | d0953e9ed1a689805de54d8c775f535e4934646b /gtk/gtkwindow.c | |
parent | 075cb4320d84ea6c5ffc09bf7318d8086d64539a (diff) | |
download | gtk+-962386fb82c0c9d040a0c92a851692c41f21f5bc.tar.gz |
Use the previously unused window->need_resize flag to mark if a window's
Mon May 11 21:04:51 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkwindow.c (gtk_real_window_move_resize): Use the
previously unused window->need_resize flag to mark if a window's
descendents changed size while the window was not visible. In this
case, when the window becomes visible, we reallocate everything,
since we didn't keep track of what actually changed.
(Fixes bug where changing the popdown strings of a
combo to something of the same length caused them to
blank out, as reported by Todd Dukes <tdukes@ibmoto.com>)
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 9608b081a5..d077514dff 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1002,11 +1002,9 @@ gtk_window_need_resize (GtkContainer *container) return return_val; if (GTK_WIDGET_VISIBLE (container)) - { - window->need_resize = TRUE; - return_val = gtk_window_move_resize (GTK_WIDGET (window)); - window->need_resize = FALSE; - } + return_val = gtk_window_move_resize (GTK_WIDGET (window)); + else + window->need_resize = TRUE; return return_val; } @@ -1019,13 +1017,17 @@ gtk_real_window_move_resize (GtkWindow *window, gint height) { GtkWidget *widget; + gboolean needed_resize; g_return_val_if_fail (window != NULL, FALSE); g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE); g_return_val_if_fail ((x != NULL) || (y != NULL), FALSE); - + widget = GTK_WIDGET (window); + needed_resize = window->need_resize; + window->need_resize = FALSE; + if ((widget->requisition.width == 0) || (widget->requisition.height == 0)) { @@ -1065,6 +1067,21 @@ gtk_real_window_move_resize (GtkWindow *window, widget->requisition.width, widget->requisition.height); } + else if (needed_resize) + { + /* The windows contents changed size while it was not + * visible, so reallocate everything, since we didn't + * keep track of what changed + */ + GtkAllocation allocation; + + allocation.x = 0; + allocation.y = 0; + allocation.width = widget->requisition.width; + allocation.height = widget->requisition.height; + + gtk_widget_size_allocate (widget, &allocation); + } else { /* The window hasn't changed size but one of its children @@ -1150,7 +1167,7 @@ gtk_real_window_move_resize (GtkWindow *window, } g_slist_free (resize_containers); } - + return FALSE; } |