applicationwindow: Don't pass for_size < -1 to measure()
authorTimm Bäder <mail@baedert.org>
Mon, 27 Dec 2021 09:00:30 +0000 (10:00 +0100)
committerTimm Bäder <mail@baedert.org>
Mon, 27 Dec 2021 11:15:02 +0000 (12:15 +0100)
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

index e7747f9a6cd0d20c2a6b168babf88bc0c13c0548..170759d772b155b8a6e55fcbce874181e68dc487 100644 (file)
@@ -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);