diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index 066f4f14..8b0a55f1 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -239,21 +239,21 @@ public final class Display { throw new NullPointerException("mode must be non-null"); boolean was_fullscreen = isFullscreen(); current_mode = mode; - if ( isCreated() ) { - destroyWindow(); - // If mode is not fullscreen capable, make sure we are in windowed mode - try { - if ( was_fullscreen && !isFullscreen() ) - display_impl.resetDisplayMode(); - else if ( isFullscreen() ) - switchDisplayMode(); - createWindow(); - makeCurrentAndSetSwapInterval(); - } catch (LWJGLException e) { - drawable.destroy(); + if ( !isCreated() || parent != null ) + return; + destroyWindow(); + // If mode is not fullscreen capable, make sure we are in windowed mode + try { + if ( was_fullscreen && !isFullscreen() ) display_impl.resetDisplayMode(); - throw e; - } + else if ( isFullscreen() ) + switchDisplayMode(); + createWindow(); + makeCurrentAndSetSwapInterval(); + } catch (LWJGLException e) { + drawable.destroy(); + display_impl.resetDisplayMode(); + throw e; } } }