summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-10-26 21:11:14 +0200
committerSven Gothel <[email protected]>2011-10-26 21:11:14 +0200
commit6b857b7826cf29fe0a588d06aade217f47edfae0 (patch)
tree5542cacfda931b607628a53be52de91e4ceee68d
parent323f49744d473ba33726d5e372ac68fa611cbd1a (diff)
NEWT/OSX: Refine comment for native requestFocus(); Remove warning
-rw-r--r--src/newt/native/MacWindow.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
index 5b7b47786..ad85c4a0c 100644
--- a/src/newt/native/MacWindow.m
+++ b/src/newt/native/MacWindow.m
@@ -474,12 +474,15 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_MacWindow_requestFocus0
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) w);
+#ifdef VERBOSE_ON
BOOL hasFocus = [win isKeyWindow];
+#endif
DBG_PRINT( "requestFocus - window: %p, force %d, hasFocus %d (START)\n", win, force, hasFocus);
- // even if we already own the focus, we need the 'focusAction()' call
- // and the other probably redundant NS calls don't harm.
+ // Even if we already own the focus, we need the 'focusAction()' call
+ // and the other probably redundant NS calls to force proper focus traversal
+ // of the parent TK (AWT doesn't do it properly on OSX).
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];