From 705c7f7b3fb36c1d654f5d9b9016859506d93764 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 9 Apr 2019 21:33:17 +0200 Subject: Bug 1362: Minimal action required: setBackground of the parent canvas before reparenting! Bug 1362 fix or workaround: Seems SWT/GTK3 at least performs lazy initialization Minimal action required: setBackground of the parent canvas before reparenting! --- src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java index 58b5bbcb9..a34c8648a 100644 --- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java @@ -62,6 +62,7 @@ import jogamp.opengl.GLDrawableHelper; import jogamp.opengl.GLDrawableImpl; import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Canvas; @@ -381,6 +382,10 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS drawable = null; context = 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)); + final Listener listener = new Listener () { @Override public void handleEvent (final Event event) { -- cgit v1.2.3