diff options
author | Sven Gothel <[email protected]> | 2020-01-06 04:49:15 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-01-06 04:49:15 +0100 |
commit | 69db39c035455fc0154006304e7340d825415e99 (patch) | |
tree | c746abc3fbebbca9510f4cafee6543477659bdbd /src | |
parent | 8caf3fab68dc890855961d22cb235d1c8f5c52c6 (diff) |
SWT GLCanvas: Fix NPE in DEBUG mode; NewtCanvasSWT: Resurect comment in setBounds(..)
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java | 4 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java index 6ca53b3f2..257c71ee7 100644 --- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java @@ -543,7 +543,9 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS res = false; } if(DEBUG) { - System.err.println(getThreadName()+": SWT.GLCanvas.validate.X "+toHexString(hashCode())+": "+res+", drawable-realized "+drawable.isRealized()+", has context "+(null!=context)); + final boolean isDrawableNull = null == drawable; + final boolean isDrawableRealized = !isDrawableNull ? drawable.isRealized() : false; + System.err.println(getThreadName()+": SWT.GLCanvas.validate.X "+toHexString(hashCode())+": "+res+", drawable[null "+isDrawableNull+", realized "+isDrawableRealized+"], has context "+(null!=context)); } } finally { _lock.unlock(); diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java index 6344ad9ca..117c1ca47 100644 --- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java +++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java @@ -222,7 +222,8 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC System.err.println("NewtCanvasSWT.setBounds: "+x+"/"+y+" "+width+"x"+height); } if( SWTAccessor.isOSX ) { - // Force newtChild to update its size and position (OSX only) + // Propagate the setBounds method coming from parent elements to this element + // and force newtChild to update its position (OSX only) updatePosSizeCheck(true /* updatePos */); } } |