Validate PApplet AWT Container after add of OpenGL canvas.

This fix a long startup delay before OpenGL init
that may happen if the OpenGL canvas stay non-visible.

Signed-off-by: Xerxes Rånby <xerxes@zafena.se>
This commit is contained in:
Xerxes Rånby
2013-03-30 23:28:36 +01:00
parent 6ed4be1f16
commit 9b3d6e73df

View File

@@ -624,6 +624,7 @@ public class PGL {
pg.parent.setLayout(new BorderLayout());
pg.parent.add(canvasAWT, BorderLayout.CENTER);
pg.parent.validate();
pg.parent.removeListeners(pg.parent);
pg.parent.addListeners(canvasAWT);
@@ -641,6 +642,7 @@ public class PGL {
pg.parent.setLayout(new BorderLayout());
pg.parent.add(canvasNEWT, BorderLayout.CENTER);
pg.parent.validate();
if (events == NEWT) {
NEWTMouseListener mouseListener = new NEWTMouseListener();