mirror of
https://github.com/processing/processing4.git
synced 2026-02-28 01:34:31 +01:00
added requestFocus() to PGraphicsOpenGL, PGL
This commit is contained in:
@@ -569,8 +569,6 @@ public class PGL {
|
||||
|
||||
listener = new PGLListener();
|
||||
canvasAWT.addGLEventListener(listener);
|
||||
|
||||
canvasAWT.requestFocus();
|
||||
} else if (WINDOW_TOOLKIT == NEWT) {
|
||||
window = GLWindow.create(caps);
|
||||
if (sharedCtx != null) {
|
||||
@@ -601,8 +599,6 @@ public class PGL {
|
||||
|
||||
listener = new PGLListener();
|
||||
window.addGLEventListener(listener);
|
||||
|
||||
canvasNEWT.requestFocus();
|
||||
}
|
||||
|
||||
fboLayerCreated = false;
|
||||
@@ -1135,6 +1131,14 @@ public class PGL {
|
||||
}
|
||||
|
||||
|
||||
protected void requestFocus() {
|
||||
if (canvas != null) {
|
||||
System.out.println("request focus for the GL canvas");
|
||||
canvas.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected boolean canDraw() {
|
||||
return pg.initialized && pg.parent.isDisplayable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user