From aaa2b1df6ba9bd30f251ddada32ba0d56b12aa81 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 28 Nov 2010 03:31:30 +0100 Subject: NewtCanvasAWT: disableBackgroundErase() before (X11) and after (Windows) addNotify(). This change is in sync with 86c164950b0a0d351fc8af3884187b10201b6237 --- src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/newt/classes/com/jogamp') diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index a0ab5f9f6..bee81624a 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -140,8 +140,16 @@ public class NewtCanvasAWT extends java.awt.Canvas { } public void addNotify() { + + // before native peer is valid: X11 + disableBackgroundErase(); + + // creates the native peer super.addNotify(); + + // after native peer is valid: Windows disableBackgroundErase(); + java.awt.Container cont = getContainer(this); if(DEBUG) { // if ( isShowing() == false ) -> Container was not visible yet. @@ -304,13 +312,22 @@ public class NewtCanvasAWT extends java.awt.Canvas { } catch (Exception e) { } disableBackgroundEraseInitialized = true; + if(DEBUG) { + System.err.println("NewtCanvasAWT: TK disableBackgroundErase method found: "+ + (null!=disableBackgroundEraseMethod)); + } } if (disableBackgroundEraseMethod != null) { + Throwable t=null; try { disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this }); } catch (Exception e) { // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10) // throw new GLException(e); + t = e; + } + if(DEBUG) { + System.err.println("NewtCanvasAWT: TK disableBackgroundErase error: "+t); } } } -- cgit v1.2.3