diff options
-rw-r--r-- | make/scripts/tests.sh | 2 | ||||
-rw-r--r-- | src/newt/native/MacWindow.m | 13 | ||||
-rw-r--r-- | src/newt/native/NewtMacWindow.h | 3 | ||||
-rw-r--r-- | src/newt/native/NewtMacWindow.m | 21 |
4 files changed, 38 insertions, 1 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 56a07e768..915752bef 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -90,7 +90,7 @@ function jrun() { #D_ARGS="-Djogl.debug=all" #D_ARGS="-Dnewt.debug=all" #D_ARGS="-Djogl.debug=all -Dnewt.debug=all" - D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all" + #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all" #D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all -Djogamp.debug.Lock" diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m index f0ed170f0..3e8935787 100644 --- a/src/newt/native/MacWindow.m +++ b/src/newt/native/MacWindow.m @@ -827,8 +827,21 @@ NS_ENDHANDLER NS_DURING // Available >= 10.5 - Makes the menubar disapear if( fullscreen ) { + /** + * See Bug 914: We don't use exclusive fullscreen anymore (capturing display) + * allowing ALT-TAB to allow process/app switching! + * Shall have no penalty on modern GPU and is also recommended, see bottom box @ + * <https://developer.apple.com/library/mac/documentation/graphicsimaging/Conceptual/QuartzDisplayServicesConceptual/Articles/DisplayCapture.html> + * if ( [myView respondsToSelector:@selector(enterFullScreenMode:withOptions:)] ) { [myView enterFullScreenMode: myScreen withOptions:NULL]; + } */ + if ( 0 != myView->fullscreenPresentationOptions ) { + [NSApp setPresentationOptions: myView->fullscreenPresentationOptions]; + } + } else { + if ( 0 != myView->defaultPresentationOptions ) { + [NSApp setPresentationOptions: myView->defaultPresentationOptions]; } } NS_HANDLER diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h index c9d53f53b..a3bd5c41b 100644 --- a/src/newt/native/NewtMacWindow.h +++ b/src/newt/native/NewtMacWindow.h @@ -64,6 +64,9 @@ volatile NSTrackingRectTag ptrTrackingTag; NSRect ptrRect; NSCursor * myCursor; +@public + NSUInteger defaultPresentationOptions; + NSUInteger fullscreenPresentationOptions; } - (id)initWithFrame:(NSRect)frameRect; diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m index 686e5d2b0..266b63081 100644 --- a/src/newt/native/NewtMacWindow.m +++ b/src/newt/native/NewtMacWindow.m @@ -129,6 +129,27 @@ static jmethodID windowRepaintID = NULL; */ myCursor = NULL; + // OSX 10.6 + if ( [NSApp respondsToSelector:@selector(currentSystemPresentationOptions)] && + [NSApp respondsToSelector:@selector(setPresentationOptions:)] ) { + defaultPresentationOptions = [NSApp currentSystemPresentationOptions]; + fullscreenPresentationOptions = + // NSApplicationPresentationDefault| + // NSApplicationPresentationAutoHideDock| + NSApplicationPresentationHideDock| + // NSApplicationPresentationAutoHideMenuBar| + NSApplicationPresentationHideMenuBar| + NSApplicationPresentationDisableAppleMenu| + // NSApplicationPresentationDisableProcessSwitching| + // NSApplicationPresentationDisableSessionTermination| + NSApplicationPresentationDisableHideApplication| + // NSApplicationPresentationDisableMenuBarTransparency| + 0 ; + } else { + defaultPresentationOptions = 0; + fullscreenPresentationOptions = 0; + } + DBG_PRINT("NewtView::create: %p (refcnt %d)\n", res, (int)[res retainCount]); return res; } |