diff options
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java index 9ba591e5f..01141c121 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java @@ -111,7 +111,13 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { device = ((AWTGraphicsDevice) absDevice).getGraphicsDevice(); } - int screen = X11SunJDKReflection.graphicsDeviceGetScreen(device); + int screen; + if (isXineramaEnabled()) { + screen = 0; + } else { + screen = X11SunJDKReflection.graphicsDeviceGetScreen(device); + } + // Until we have a rock-solid visual selection algorithm written // in pure Java, we're going to provide the underlying window // system's selection to the chooser as a hint @@ -520,12 +526,29 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { } } + //--------------------------------------------------------------------------- + // Xinerama-related functionality + // + + private boolean checkedXinerama; + private boolean xineramaEnabled; + protected synchronized boolean isXineramaEnabled() { + if (!checkedXinerama) { + checkedXinerama = true; + lockToolkit(); + long display = getDisplayConnection(); + xineramaEnabled = GLX.XineramaEnabled(display); + unlockToolkit(); + } + return xineramaEnabled; + } + //---------------------------------------------------------------------- // Gamma-related functionality // - boolean gotGammaRampLength; - int gammaRampLength; + private boolean gotGammaRampLength; + private int gammaRampLength; protected synchronized int getGammaRampLength() { if (gotGammaRampLength) { return gammaRampLength; |