aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native/MacWindow.m
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-22 15:54:58 +0200
committerSven Gothel <[email protected]>2011-10-22 15:54:58 +0200
commitcba9a070f9649bec42627631d393963d548e320c (patch)
treecda7fb5c364afd86779a756132ddec023131bb3a /src/newt/native/MacWindow.m
parenta9494e62a039d2b4bb0c8f7492e273aad44531c5 (diff)
NEWT/Native RequestFocus: Even if owning focus, run the focusAction() call incl. native focus request (X11, Windows, OSX)
Diffstat (limited to 'src/newt/native/MacWindow.m')
-rw-r--r--src/newt/native/MacWindow.m18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
index eaad388c3..5b7b47786 100644
--- a/src/newt/native/MacWindow.m
+++ b/src/newt/native/MacWindow.m
@@ -478,15 +478,15 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_MacWindow_requestFocus0
DBG_PRINT( "requestFocus - window: %p, force %d, hasFocus %d (START)\n", win, force, hasFocus);
- if( JNI_TRUE==force || !hasFocus ) {
- if( JNI_TRUE==force || JNI_FALSE == (*env)->CallBooleanMethod(env, window, focusActionID) ) {
- DBG_PRINT( "makeKeyWindow win %p\n", win);
- // [win performSelectorOnMainThread:@selector(orderFrontRegardless) withObject:nil waitUntilDone:YES];
- // [win performSelectorOnMainThread:@selector(makeKeyWindow) withObject:nil waitUntilDone:YES];
- [win orderFrontRegardless];
- [win makeKeyWindow];
- [win makeFirstResponder: nil];
- }
+ // even if we already own the focus, we need the 'focusAction()' call
+ // and the other probably redundant NS calls don't harm.
+ if( JNI_TRUE==force || JNI_FALSE == (*env)->CallBooleanMethod(env, window, focusActionID) ) {
+ DBG_PRINT( "makeKeyWindow win %p\n", win);
+ // [win performSelectorOnMainThread:@selector(orderFrontRegardless) withObject:nil waitUntilDone:YES];
+ // [win performSelectorOnMainThread:@selector(makeKeyWindow) withObject:nil waitUntilDone:YES];
+ [win orderFrontRegardless];
+ [win makeKeyWindow];
+ [win makeFirstResponder: nil];
}
DBG_PRINT( "requestFocus - window: %p, force %d (END)\n", win, force);