[gtk/wip/baedert/for-master: 2/2] applicationwindow: Don't pass for_size < -1 to measure()




commit 4fa3641c885212b6c6f4730780c959ec9513145c
Author: Timm Bäder <mail baedert org>
Date:   Mon Dec 27 10:00:30 2021 +0100

    applicationwindow: Don't pass for_size < -1 to measure()
    
    If the application window is measured with for_size -1 horizontally,
    this code clearly passes something lower to the parent class measure()
    implementation. Only subtract the menubar_height if we're passed a
    for_size > -1.

 gtk/gtkapplicationwindow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index e7747f9a6c..eed2308b42 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -435,9 +435,11 @@ gtk_application_window_measure (GtkWidget      *widget,
           gtk_widget_measure (priv->menubar, GTK_ORIENTATION_VERTICAL,
                               for_size, &menubar_height, NULL, NULL, NULL);
 
+
           GTK_WIDGET_CLASS (gtk_application_window_parent_class)->measure (widget,
                                                                            orientation,
-                                                                           for_size - menubar_height,
+                                                                           for_size > -1 :
+                                                                             for_size - menubar_height : -1,
                                                                            minimum, natural,
                                                                            minimum_baseline, 
natural_baseline);
 


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