changeset 12331:57f4422b7bdb

8081371: [PIT] Test closed/java/awt/FullScreen/DisplayMode/CycleDMImage.java switches Linux to the single device mode Reviewed-by: alexsch, serb
author azvegint
date Mon, 22 Jun 2015 15:47:44 +0300
parents c49563fe72fe
children 48967684d5de
files src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java	Mon Jun 22 15:43:40 2015 +0300
+++ b/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java	Mon Jun 22 15:47:44 2015 +0300
@@ -284,7 +284,6 @@
      * 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) {
@@ -316,7 +315,9 @@
 
     @Override
     public boolean isDisplayChangeSupported() {
-        return (isFullScreenSupported() && (getFullScreenWindow() != null));
+        return (isFullScreenSupported()
+                && !((X11GraphicsEnvironment) GraphicsEnvironment
+                        .getLocalGraphicsEnvironment()).runningXinerama());
     }
 
     private static void enterFullScreenExclusive(Window w) {
@@ -346,7 +347,9 @@
         if (fsSupported && old != null) {
             // enter windowed mode (and restore original display mode)
             exitFullScreenExclusive(old);
-            setDisplayMode(origDisplayMode);
+            if (isDisplayChangeSupported()) {
+                setDisplayMode(origDisplayMode);
+            }
         }
 
         super.setFullScreenWindow(w);
@@ -428,7 +431,9 @@
                     Window old = getFullScreenWindow();
                     if (old != null) {
                         exitFullScreenExclusive(old);
-                        setDisplayMode(origDisplayMode);
+                        if (isDisplayChangeSupported()) {
+                            setDisplayMode(origDisplayMode);
+                        }
                     }
                 };
                 String name = "Display-Change-Shutdown-Thread-" + screen;