diff --git a/src/java/org/lwjgl/opengl/AWTSurfaceLock.java b/src/java/org/lwjgl/opengl/AWTSurfaceLock.java index 5a3730e6..bf9bae6e 100644 --- a/src/java/org/lwjgl/opengl/AWTSurfaceLock.java +++ b/src/java/org/lwjgl/opengl/AWTSurfaceLock.java @@ -80,8 +80,8 @@ final class AWTSurfaceLock { // It is only needed on first call, so we avoid it on all subsequent calls // due to performance.. - // Allow the use of a Core Animation Layer only when using Display.setParent() or AWTGLCanvas and when not in fullscreen - final boolean allowCALayer = (Display.getParent() != null || component instanceof AWTGLCanvas) && !Display.isFullscreen(); + // Allow the use of a Core Animation Layer only when using non fullscreen Display.setParent() or AWTGLCanvas + final boolean allowCALayer = (Display.getParent() != null && !Display.isFullscreen()) || component instanceof AWTGLCanvas; if (firstLockSucceeded) return lockAndInitHandle(lock_buffer, component, allowCALayer); diff --git a/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java b/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java index 824a112b..e9d506c1 100644 --- a/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java +++ b/src/java/org/lwjgl/opengl/MacOSXCanvasPeerInfo.java @@ -50,8 +50,8 @@ abstract class MacOSXCanvasPeerInfo extends MacOSXPeerInfo { } protected void initHandle(Canvas component) throws LWJGLException { - // Allow the use of a Core Animation Layer only when using Display.setParent() or AWTGLCanvas and when not in fullscreen - final boolean allowCALayer = (Display.getParent() != null || component instanceof AWTGLCanvas) && !Display.isFullscreen(); + // Allow the use of a Core Animation Layer only when using non fullscreen Display.setParent() or AWTGLCanvas + final boolean allowCALayer = (Display.getParent() != null && !Display.isFullscreen()) || component instanceof AWTGLCanvas; nInitHandle(awt_surface.lockAndGetHandle(component), getHandle(), allowCALayer); }