another focus tweak

This commit is contained in:
Ben Fry
2013-06-03 11:36:22 -04:00
parent 57d0ac36fb
commit 9d4da2fa3f
2 changed files with 5 additions and 3 deletions

View File

@@ -2157,7 +2157,7 @@ public class PApplet extends Applet
//requestFocusInWindow();
// For 2.0, pass this to the renderer, to lend a hand to OpenGL
g.requestFocus(PApplet.this);
g.requestFocus();
}
});
}

View File

@@ -808,8 +808,10 @@ public class PGraphics extends PImage implements PConstants {
* Handle grabbing the focus from the parent applet. Other renderers can
* override this if handling needs to be different.
*/
public void requestFocus(Component parent) { // ignore
parent.requestFocusInWindow();
public void requestFocus() { // ignore
if (parent != null) {
parent.requestFocusInWindow();
}
}