From cf7fa931d380c6d205478c87f0f3973f496f9d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 15 Jul 2018 17:56:11 +0200 Subject: [PATCH] sizerequest: Only check reported baselines if requested If the passed-in store locations for the baselines are NULL anyway, we don't need to check the reported baselines for correctness. --- gtk/gtksizerequest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index f85f989337..411cc103bc 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -129,6 +129,7 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, gint *minimum_baseline, gint *natural_baseline) { + const gboolean baselines_requested = (minimum_baseline != NULL || natural_baseline != NULL); SizeRequestCache *cache; gint min_size = 0; gint nat_size = 0; @@ -291,7 +292,7 @@ gtk_widget_query_size_for_orientation (GtkWidget *widget, nat_size = adjusted_natural; } - if (min_baseline != -1 || nat_baseline != -1) + if (baselines_requested && (min_baseline != -1 || nat_baseline != -1)) { if (orientation == GTK_ORIENTATION_HORIZONTAL) {