widget: Call size_allocate vfunc directly when possible

This avoids all the overhead of signal emissions when it is not used.
This commit is contained in:
Alexander Larsson 2015-09-14 15:05:37 +02:00
parent cdd951e927
commit 68e50d20a7

View File

@ -5969,7 +5969,10 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
goto out;
priv->allocated_baseline = baseline;
if (g_signal_has_handler_pending (widget, widget_signals[SIZE_ALLOCATE], 0, FALSE))
g_signal_emit (widget, widget_signals[SIZE_ALLOCATE], 0, &real_allocation);
else
GTK_WIDGET_GET_CLASS (widget)->size_allocate (widget, &real_allocation);
/* Size allocation is god... after consulting god, no further requests or allocations are needed */
priv->alloc_needed = FALSE;