Question

I'm in the process of writing a Mac (10.6 / 10.7) application that authenticates users against an Active Directory domain before allowing them access to the computer (I'm told I can't allow users to log on via traditional log on services). I have the authentication code in place, and am now trying to make this login window fullscreen and unable to close.

Apple's Kiosk Mode API (documentation here) seems like a great fit for this, and I've used it to bring the window fullscreen, disable the dock / menu bar / force quit, etc., most of which works fine. However, I've found that when I set the view of my window to be in full screen mode, attempting to bring up the Force Quit window crashes the application (either to the desktop, or while still fullscreen and requiring a complete reboot).

Code example:

NSApplicationPresentationOptions options = 
NSApplicationPresentationHideMenuBar|NSApplicationPresentationHideDock|
NSApplicationPresentationDisableHideApplication|
NSApplicationPresentationDisableProcessSwitching|
NSApplicationPresentationDisableAppleMenu|
NSApplicationPresentationDisableForceQuit;

[NSApp setPresentationOptions:options];
[[_window contentView] enterFullScreenMode:[NSScreen mainScreen] withOptions:nil];

The only thing I can think of is that the NSApplication options aren't entirely being retained when switching to full screen; every option besides Disable Force Quit seems to carry over though. Any suggestions appreciated!

Was it helpful?

Solution

That's actually normal behaviour on the Mac for a fullscreen app. When you use Cmd+Opt+Esc in a fullscreen app, it will immediately terminate the process that has captured the screen rather than presenting the standard termination UI.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top