[gtk/misc-speedups: 10/11] sizerequest: Keep branches in sync




commit 0d8dd0c664594e468e09014e8f8ada749992994a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 24 18:41:09 2021 -0400

    sizerequest: Keep branches in sync
    
    There are some unintentional differences between
    the path that uses a layout manager, and the path
    that uses widget vfuncs. Sync them up.

 gtk/gtksizerequest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 935112061a..0a1bc48774 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -272,13 +272,13 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
               gtk_widget_measure (widget, OPPOSITE_ORIENTATION (orientation), -1,
                                   &minimum_for_size, &natural_for_size, NULL, NULL);
 
-              /* TODO: Warn if the given for_size is too small? */
               if (for_size < MAX (minimum_for_size, css_min_for_size))
                 for_size = MAX (minimum_for_size, css_min_for_size);
 
               adjusted_for_size = for_size - widget_margins_for_size;
-
               adjusted_for_size -= css_extra_for_size;
+              if (adjusted_for_size < 0)
+                adjusted_for_size = MAX (minimum_for_size, css_min_for_size);
 
               push_recursion_check (widget, orientation);
               widget_class->measure (widget,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]