From 538a41849192cc09da36eeaa5fa9ae10973d85b7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 14 Mar 2013 17:22:22 +0100 Subject: Fix NEWT WindowImpl reparent-recreate w/ GLEventListenerState: Bug introduced w/ commit e2506d7663b752f00f0a98f793ebad52e65bd1e3 In case a reparent action takes place w/ recreate, only preserve the GLEventListenerState if the window is valid and will become visible again (wasVisible). Also add proper DEBUG log prefix to GLEventListenerState. --- src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/jogamp') diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java index e6652cfac..592607819 100644 --- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java +++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java @@ -109,6 +109,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, FPSCounter { * {@link #pullGLEventListenerState() pull} to preserve the {@link GLEventListenerState}. */ public final void setPreserveGLStateAtDestroy(boolean value) { + if( DEBUG ) { + System.err.println("GLAutoDrawableBase.setPreserveGLStateAtDestroy: ("+Thread.currentThread().getName()+"): "+preserveGLELSAtDestroy+" -> "+value+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle())); + } preserveGLELSAtDestroy = value; } @@ -283,7 +286,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, FPSCounter { */ protected void destroyImplInLock() { if( preserveGLELSAtDestroy ) { - preserveGLELSAtDestroy = false; + setPreserveGLStateAtDestroy(false); pullGLEventListenerState(); } if( null != context ) { -- cgit v1.2.3