Commit a474beb7 authored by Timm Bäder's avatar Timm Bäder 🤔
Browse files

widget: Don't always call get_display() when allocating

The GTK_DISPLAY_DEBUG_CHECK macro will cleverly only call the function
if any of the display debug flags are set, so in the common case it
won't even be executed.
parent 321a2101
......@@ -4289,9 +4289,6 @@ gtk_widget_allocate (GtkWidget *widget,
GtkCssStyle *style;
GtkBorder margin, border, padding;
GskTransform *css_transform;
GdkDisplay *display;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (baseline >= -1);
......@@ -4302,8 +4299,7 @@ gtk_widget_allocate (GtkWidget *widget,
goto out;
display = _gtk_widget_get_display (widget);
if (GTK_DISPLAY_DEBUG_CHECK (_gtk_widget_get_display (widget), RESIZE))
priv->highlight_resize = TRUE;
gtk_widget_queue_draw (widget);
......@@ -4483,7 +4479,8 @@ gtk_widget_allocate (GtkWidget *widget,
/* Size allocation is god... after consulting god, no further requests or allocations are needed */
if (GTK_DISPLAY_DEBUG_CHECK (display, GEOMETRY) && gtk_widget_get_resize_needed (widget))
if (GTK_DISPLAY_DEBUG_CHECK (_gtk_widget_get_display (widget), GEOMETRY) &&
gtk_widget_get_resize_needed (widget))
g_warning ("%s %p or a child called gtk_widget_queue_resize() during size_allocate().",
gtk_widget_get_name (widget), widget);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment