From c7159c680cf121a1ad17b88c768bdbd342c5327a Mon Sep 17 00:00:00 2001 From: prr Date: Wed, 29 Apr 2015 13:28:08 -0700 Subject: [PATCH] 7145508: java.awt.GraphicsDevice.get/setDisplayMode behavior is incorrect when no display is present Reviewed-by: bae, serb --- src/solaris/classes/sun/awt/X11GraphicsDevice.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/solaris/classes/sun/awt/X11GraphicsDevice.java b/src/solaris/classes/sun/awt/X11GraphicsDevice.java index b5e982154..7ffa13286 100644 --- a/src/solaris/classes/sun/awt/X11GraphicsDevice.java +++ b/src/solaris/classes/sun/awt/X11GraphicsDevice.java @@ -375,7 +375,11 @@ public class X11GraphicsDevice @Override public synchronized DisplayMode getDisplayMode() { if (isFullScreenSupported()) { - return getCurrentDisplayMode(screen); + DisplayMode mode = getCurrentDisplayMode(screen); + if (mode == null) { + mode = getDefaultDisplayMode(); + } + return mode; } else { if (origDisplayMode == null) { origDisplayMode = getDefaultDisplayMode(); -- GitLab