From c3c204a2e374c1dc4c1fb51f15444e5b92850839 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 10 Feb 2014 18:46:28 +0100 Subject: Bug 970: NEWT OSX ChildWindow setVisible(..) does not hide child window appropriately Instead of using [mWin orderBack: mWin] for child windows, utilize [mWin orderWindow: NSWindowOut relativeTo: [pWin windowNumber]] --- src/newt/native/MacWindow.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/newt') diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m index 130b2e3e3..25ea47c47 100644 --- a/src/newt/native/MacWindow.m +++ b/src/newt/native/MacWindow.m @@ -1133,13 +1133,18 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_orderFront0 (JNIEnv *env, jobject unused, jlong window) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSWindow* win = (NSWindow*) ((intptr_t) window); + NSWindow* mWin = (NSWindow*) ((intptr_t) window); + NSWindow* pWin = [mWin parentWindow]; - DBG_PRINT( "orderFront0 - window: %p (START)\n", win); + DBG_PRINT( "orderFront0 - window: (parent %p) %p visible %d (START)\n", pWin, mWin, [mWin isVisible]); - [win orderFrontRegardless]; + if( NULL == pWin ) { + [mWin orderFrontRegardless]; + } else { + [mWin orderWindow: NSWindowAbove relativeTo: [pWin windowNumber]]; + } - DBG_PRINT( "orderFront0 - window: %p (END)\n", win); + DBG_PRINT( "orderFront0 - window: (parent %p) %p (END)\n", pWin, mWin); [pool release]; } @@ -1155,14 +1160,13 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_orderOut0 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSWindow* mWin = (NSWindow*) ((intptr_t) window); NSWindow* pWin = [mWin parentWindow]; - BOOL pWinVisible = NULL != pWin ? [pWin isVisible] : 0; - DBG_PRINT( "orderOut0 - window: (parent %p visible %d) %p visible %d (START)\n", pWin, pWinVisible, mWin, [mWin isVisible]); + DBG_PRINT( "orderOut0 - window: (parent %p) %p visible %d (START)\n", pWin, mWin, [mWin isVisible]); - if( NULL == pWin || !pWinVisible ) { + if( NULL == pWin ) { [mWin orderOut: mWin]; } else { - [mWin orderBack: mWin]; + [mWin orderWindow: NSWindowOut relativeTo: [pWin windowNumber]]; } DBG_PRINT( "orderOut0 - window: (parent %p) %p (END)\n", pWin, mWin); -- cgit v1.2.3