Permalink
Browse files

request glwindow focus in the EDT

  • Loading branch information...
codeanticode committed Sep 12, 2015
1 parent 528f225 commit 4c0f9234c0a48f62363233cafc9c9951ee351d3e
Showing with 10 additions and 7 deletions.
  1. +10 −7 core/src/processing/opengl/PSurfaceJOGL.java
@@ -699,9 +699,12 @@ public void setFrameRate(float fps) {
public void requestFocus() {
if (window != null) {
window.requestFocus();
}
display.getEDTUtil().invoke(false, new Runnable() {
@Override
public void run() {
window.requestFocus();
}
});
}
@@ -713,6 +716,10 @@ public void display(GLAutoDrawable drawable) {
return;
}
if (sketch.frameCount == 0) {
requestFocus();
}
pgl.getGL(drawable);
int pframeCount = sketch.frameCount;
sketch.handleDraw();
@@ -723,10 +730,6 @@ public void display(GLAutoDrawable drawable) {
pgl.endRender(sketch.sketchWindowColor());
}
if (sketch.frameCount == 1) {
requestFocus();
}
if (sketch.exitCalled()) {
sketch.dispose(); // calls stopThread(), which stops the animator.
sketch.exitActual();

0 comments on commit 4c0f923

Please sign in to comment.