From eff5bc3b51a7604bce8c1db89e53be57fffd9a8c Mon Sep 17 00:00:00 2001 From: azvegint Date: Mon, 22 Jun 2015 15:47:44 +0300 Subject: [PATCH] 8081371: [PIT] Test closed/java/awt/FullScreen/DisplayMode/CycleDMImage.java switches Linux to the single device mode Reviewed-by: alexsch, serb --- src/solaris/classes/sun/awt/X11GraphicsDevice.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/solaris/classes/sun/awt/X11GraphicsDevice.java b/src/solaris/classes/sun/awt/X11GraphicsDevice.java index 7ffa13286..3749b8242 100644 --- a/src/solaris/classes/sun/awt/X11GraphicsDevice.java +++ b/src/solaris/classes/sun/awt/X11GraphicsDevice.java @@ -286,7 +286,6 @@ public class X11GraphicsDevice * Returns true only if: * - the Xrandr extension is present * - the necessary Xrandr functions were loaded successfully - * - XINERAMA is not enabled */ private static synchronized boolean isXrandrExtensionSupported() { if (xrandrExtSupported == null) { @@ -318,7 +317,9 @@ public class X11GraphicsDevice @Override public boolean isDisplayChangeSupported() { - return (isFullScreenSupported() && (getFullScreenWindow() != null)); + return (isFullScreenSupported() + && !((X11GraphicsEnvironment) GraphicsEnvironment + .getLocalGraphicsEnvironment()).runningXinerama()); } private static void enterFullScreenExclusive(Window w) { @@ -348,7 +349,9 @@ public class X11GraphicsDevice if (fsSupported && old != null) { // enter windowed mode (and restore original display mode) exitFullScreenExclusive(old); - setDisplayMode(origDisplayMode); + if (isDisplayChangeSupported()) { + setDisplayMode(origDisplayMode); + } } super.setFullScreenWindow(w); @@ -431,7 +434,9 @@ public class X11GraphicsDevice Window old = getFullScreenWindow(); if (old != null) { exitFullScreenExclusive(old); - setDisplayMode(origDisplayMode); + if (isDisplayChangeSupported()) { + setDisplayMode(origDisplayMode); + } } }; Thread t = new Thread(rootTG, r,"Display-Change-Shutdown-Thread-"+screen); -- GitLab