7145508: java.awt.GraphicsDevice.get/setDisplayMode behavior is incorrect when no display is present
Reviewed-by: serb, bae
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java Sun Apr 19 10:31:06 2015 +0300
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java Mon Apr 20 10:39:30 2015 -0700
@@ -380,7 +380,11 @@
@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();