File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
py5_jar/src/main/java/py5/core Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -191,14 +191,12 @@ public void setup() {
191
191
PSurface surface = getSurface ();
192
192
193
193
// request focus for Java2D renderer on Windows and MacOS
194
- if (sketchRenderer ().equals (JAVA2D )) {
195
- if (platform == WINDOWS ) {
196
- Canvas canvas = (Canvas ) surface .getNative ();
197
- canvas .setFocusable (true );
198
- canvas .requestFocus ();
199
- } else if (platform == MACOS ) {
200
- ThinkDifferent .activateIgnoringOtherApps ();
201
- }
194
+ if (platform == WINDOWS && sketchRenderer ().equals (JAVA2D )) {
195
+ Canvas canvas = (Canvas ) surface .getNative ();
196
+ canvas .setFocusable (true );
197
+ canvas .requestFocus ();
198
+ } else if (platform == MACOS && (sketchRenderer ().equals (JAVA2D ) || g .isGL ())) {
199
+ ThinkDifferent .activateIgnoringOtherApps ();
202
200
}
203
201
204
202
if (py5IconPath != null && !(g instanceof PGraphicsOpenGL )) {
@@ -229,8 +227,7 @@ public void setup() {
229
227
capturePixels ();
230
228
GLWindow window = (GLWindow ) surface .getNative ();
231
229
long windowHandle = window .getWindowHandle ();
232
- // also need to pass the window handle to the bridge to make a Windows
233
- // API call to request focus
230
+ // the bridge will make a Windows API call to request focus
234
231
py5Bridge .focus_window (windowHandle );
235
232
}
236
233
}
You can’t perform that action at this time.
0 commit comments