diff options
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java index 735a2a21c..97a3321d5 100644 --- a/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java @@ -86,6 +86,8 @@ import com.jogamp.opengl.GLSharedContextSetter; import com.jogamp.opengl.Threading; import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.os.Platform; +import com.jogamp.common.os.Platform.OSType; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.awt.AWTEDTExecutor; import com.jogamp.common.util.locks.LockFactory; @@ -169,6 +171,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing private static final boolean DEBUG = Debug.debug("GLCanvas"); + private static JAWTUtil.BackgroundEraseControl backgroundEraseControl = new JAWTUtil.BackgroundEraseControl(); + private final RecursiveLock lock = LockFactory.createRecursiveLock(); private final GLDrawableHelper helper = new GLDrawableHelper(); private volatile GLDrawableImpl drawable; // volatile: avoid locking for read-only access @@ -589,7 +593,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing */ // before native peer is valid: X11 - JAWTUtil.disableBackgroundErase(this); + if( OSType.WINDOWS != Platform.getOSType() ) { + backgroundEraseControl.disable(this); + } final GraphicsDevice awtDevice; if(null==awtDeviceReq) { @@ -614,7 +620,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing super.addNotify(); // after native peer is valid: Windows - JAWTUtil.disableBackgroundErase(this); + if( OSType.WINDOWS == Platform.getOSType() ) { + backgroundEraseControl.disable(this); + } createJAWTDrawableAndContext(); |