summaryrefslogtreecommitdiff
path: root/java/openjdk17/files
diff options
context:
space:
mode:
authorSean Farley <scf@FreeBSD.org>2022-05-30 17:37:59 -0700
committerGreg Lewis <glewis@FreeBSD.org>2022-05-30 17:42:52 -0700
commit0de164bdb551505ac86059866d855a8035de983f (patch)
treeaa509a49efa767ee531953ceed5dc66dbb2c8f6a /java/openjdk17/files
parentcad/horizon-eda: Update 2.3.0 -> 2.3.1 (diff)
java/openjdk17: Fix an NPE when using a multi-screen X11 setup
PR: 264356 Reported by: scf@
Diffstat (limited to 'java/openjdk17/files')
-rw-r--r--java/openjdk17/files/patch-src_java.desktop_unix_classes_sun_awt_X11GraphicsEnvironment.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/java/openjdk17/files/patch-src_java.desktop_unix_classes_sun_awt_X11GraphicsEnvironment.java b/java/openjdk17/files/patch-src_java.desktop_unix_classes_sun_awt_X11GraphicsEnvironment.java
new file mode 100644
index 000000000000..7019cf8b290d
--- /dev/null
+++ b/java/openjdk17/files/patch-src_java.desktop_unix_classes_sun_awt_X11GraphicsEnvironment.java
@@ -0,0 +1,11 @@
+--- src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java
++++ src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java
+@@ -232,7 +232,7 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
+ throw new AWTError("no screen devices");
+ }
+ int index = getDefaultScreenNum();
+- mainScreen = 0 < index && index < screens.length ? index : 0;
++ mainScreen = 0 < index && index < numScreens ? index : 0;
+
+ for (int id = 0; id < numScreens; ++id) {
+ devices.put(id, old.containsKey(id) ? old.remove(id) :