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.
This commit is contained in:
Timm Bäder 2021-12-27 10:00:30 +01:00
parent a00480f4a1
commit e94d5bf006

View File

@ -435,9 +435,11 @@ gtk_application_window_measure (GtkWidget *widget,
gtk_widget_measure (priv->menubar, GTK_ORIENTATION_VERTICAL, gtk_widget_measure (priv->menubar, GTK_ORIENTATION_VERTICAL,
for_size, &menubar_height, NULL, NULL, NULL); for_size, &menubar_height, NULL, NULL, NULL);
GTK_WIDGET_CLASS (gtk_application_window_parent_class)->measure (widget, GTK_WIDGET_CLASS (gtk_application_window_parent_class)->measure (widget,
orientation, orientation,
for_size - menubar_height, for_size > -1 ?
for_size - menubar_height : -1,
minimum, natural, minimum, natural,
minimum_baseline, natural_baseline); minimum_baseline, natural_baseline);