mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02: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();
|
||||
}
|
||||
|
||||
@@ -1579,6 +1579,12 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void requestFocus() { // ignore
|
||||
pgl.requestFocus();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* OpenGL cannot draw until a proper native peer is available, so this
|
||||
* returns the value of PApplet.isDisplayable() (inherited from Component).
|
||||
|
||||
Reference in New Issue
Block a user