Fixing hangs with GtkScrolledWindow

Now gtk_widget_size_allocate() unsets the resize_needed flags
before returning, essentially this means that any widget that
has a queued resize and is allocated before resize time, including
queued resizes from inside a size_allocate() method will be
cancelled.
This commit is contained in:
Tristan Van Berkom 2010-11-19 00:53:13 +09:00
parent 881282e055
commit f20ac5792f

View File

@ -4386,6 +4386,11 @@ gtk_widget_queue_draw (GtkWidget *widget)
* be called when a widget for some reason has a new size request.
* For example, when you change the text in a #GtkLabel, #GtkLabel
* queues a resize to ensure there's enough space for the new text.
*
* <note><para>You cannot call gtk_widget_queue_resize() on a widget
* from inside it's implementation of the GtkWidgetClass::size_allocate
* virtual method. Calls to gtk_widget_queue_resize() from inside
* GtkWidgetClass::size_allocate will be silently ignored.</para></note>
**/
void
gtk_widget_queue_resize (GtkWidget *widget)
@ -4671,6 +4676,11 @@ gtk_widget_size_allocate (GtkWidget *widget,
g_signal_emit (widget, widget_signals[SIZE_ALLOCATE], 0, &real_allocation);
/* Size allocation is god... after consulting god, no further requests or allocations are needed */
priv->width_request_needed = FALSE;
priv->height_request_needed = FALSE;
priv->alloc_needed = FALSE;
if (gtk_widget_get_mapped (widget))
{
if (!gtk_widget_get_has_window (widget) && priv->redraw_on_alloc && position_changed)