Skip to content

Commit 9c79cf6

Browse files
committed
[Gtk] Fix GtkHeaderBar measure Gtk-WARNING
When size is not known one should pass -1 and not 0 .
1 parent 84e6db7 commit 9c79cf6

File tree

1 file changed

+2
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+2
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ long gtk_size_allocate (long widget, long allocation) {
18781878
long header = GTK4.gtk_window_get_titlebar(shellHandle);
18791879
int[] headerNaturalHeight = new int[1];
18801880
if (header != 0) {
1881-
GTK4.gtk_widget_measure(header, GTK.GTK_ORIENTATION_VERTICAL, 0, null, headerNaturalHeight, null, null);
1881+
GTK4.gtk_widget_measure(header, GTK.GTK_ORIENTATION_VERTICAL, -1, null, headerNaturalHeight, null, null);
18821882
}
18831883
widthA[0] = monitorSize.width;
18841884
heightA[0] = monitorSize.height - headerNaturalHeight[0];
@@ -2395,7 +2395,7 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
23952395
long header = GTK4.gtk_window_get_titlebar(shellHandle);
23962396
int[] headerNaturalHeight = new int[1];
23972397
if (header != 0) {
2398-
GTK4.gtk_widget_measure(header, GTK.GTK_ORIENTATION_VERTICAL, 0, null, headerNaturalHeight, null, null);
2398+
GTK4.gtk_widget_measure(header, GTK.GTK_ORIENTATION_VERTICAL, -1, null, headerNaturalHeight, null, null);
23992399
}
24002400
GTK.gtk_window_set_default_size(shellHandle, width, height + headerNaturalHeight[0]);
24012401
} else {

0 commit comments

Comments
 (0)