From 6b857b7826cf29fe0a588d06aade217f47edfae0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 26 Oct 2011 21:11:14 +0200 Subject: NEWT/OSX: Refine comment for native requestFocus(); Remove warning --- src/newt/native/MacWindow.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/newt/native/MacWindow.m') 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]; -- cgit v1.2.3