Skip to content

Commit 39a37ad

Browse files
committed
[GTK] Fix gdk_monitor_get_scale_factor on Gtk 4 on X11
One more case of #2396
1 parent e3d73d5 commit 39a37ad

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,9 @@ void setInitialBounds() {
25272527
long display = GDK.gdk_display_get_default();
25282528
if (display != 0) {
25292529
long monitor = GDK.gdk_display_get_monitor_at_surface(display, paintSurface());
2530-
GDK.gdk_monitor_get_geometry(monitor, dest);
2530+
if (monitor != 0) {
2531+
GDK.gdk_monitor_get_geometry(monitor, dest);
2532+
}
25312533
width = (int) (dest.width * SHELL_TO_MONITOR_RATIO);
25322534
height = (int) (dest.height * SHELL_TO_MONITOR_RATIO);
25332535
}

0 commit comments

Comments
 (0)