From 20921924e994e9f612a82009026081a4573b3bdd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 6 Jan 2020 18:20:09 +0100 Subject: Bug 1421: Move Bug 1362 'setBackground(..)' fix before potential 'setNEWTChild(..)' --- src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java index 117c1ca47..685eccb43 100644 --- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java +++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java @@ -145,6 +145,10 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC screen = SWTAccessor.getScreen(device, -1 /* default */); nativeWindow = null; + // Bug 1362 fix or workaround: Seems SWT/GTK3 at least performs lazy initialization + // Minimal action required: setBackground of the parent canvas before reparenting! + setBackground(new Color(parent.getDisplay(), 255, 255, 255)); + if(null != child) { setNEWTChild(child); } @@ -158,10 +162,6 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC " - surfaceHandle 0x"+Long.toHexString(nsh)); } - // Bug 1362 fix or workaround: Seems SWT/GTK3 at least performs lazy initialization - // Minimal action required: setBackground of the parent canvas before reparenting! - setBackground(new Color(parent.getDisplay(), 255, 255, 255)); - final Listener listener = new Listener () { @Override public void handleEvent (final Event event) { -- cgit v1.2.3