widget: queue a redraw only if resize highlighting is enabled
authorBenjamin Otte <otte@redhat.com>
Wed, 30 Mar 2016 19:41:08 +0000 (21:41 +0200)
committerPaolo Borelli <pborelli@gnome.org>
Wed, 30 Mar 2016 19:44:58 +0000 (21:44 +0200)
e8aa9b0440e03e7002323922f862342db51c5f32 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.

gtk/gtkwidget.c

index b7346e1f634decb3907b8e1fc2d28245c918d8b6..95b8e242bbc24e2a98d033f459c7b8300fe8af5f 100644 (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