widget: queue a redraw only if resize highlighting is enabled

e8aa9b0440 introduced a new debug mode
that highlights resizes. Unfortunately it has the side effect of
always queueing redraws even when the debug mode is not enabled.
Make the redraw conditional.
This commit is contained in:
Benjamin Otte 2016-03-30 21:41:08 +02:00 committed by Paolo Borelli
parent fd143a2b38
commit 71a5f07620

View File

@ -5959,8 +5959,11 @@ gtk_widget_size_allocate_with_baseline (GtkWidget *widget,
gtk_widget_push_verify_invariants (widget);
#ifdef G_ENABLE_DEBUG
priv->highlight_resize = TRUE;
gtk_widget_queue_draw (widget);
if (GTK_DEBUG_CHECK (RESIZE))
{
priv->highlight_resize = TRUE;
gtk_widget_queue_draw (widget);
}
if (gtk_widget_get_resize_needed (widget))
{
@ -7005,8 +7008,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
cairo_restore (cr);
}
}
if (GTK_DISPLAY_DEBUG_CHECK (gtk_widget_get_display (widget), RESIZE) &&
widget->priv->highlight_resize)
if (widget->priv->highlight_resize)
{
GtkAllocation alloc;
gtk_widget_get_allocation (widget, &alloc);
@ -7018,7 +7020,6 @@ gtk_widget_draw_internal (GtkWidget *widget,
gtk_widget_queue_draw (widget);
widget->priv->highlight_resize = FALSE;
}
#endif