8081371: [PIT] Test closed/java/awt/FullScreen/DisplayMode/CycleDMImage.java switches Linux to the single device mode
Reviewed-by: alexsch, serb
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java Mon Jun 22 15:43:40 2015 +0300
+++ b/jdk/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;