In juce_mac_NSViewComponentPeer.mm Desktop::setKioskComponent I got it working with the following approach:
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (peer->hasNativeTitleBar()
&& [peer->window respondsToSelector: @selector (toggleFullScreen:)])
{
//enableOrDisable when true means we're enabling? Restrict the menu and dock if desired
if (enableOrDisable && ! allowMenusAndBars)
[NSApp setPresentationOptions: NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar];
//removed the withObject: enableOrDisable bool param..not sure what purpose it served
[peer->window performSelector: @selector (toggleFullScreen:) withObject: nil];
}
Added NSWindowDelegate windowDidExitFullScreen to reset the options after full screen exited (doesn't work if done at an earlier stage). This is needed due to using the NSApp setPresentationOptions as opposed to the proper method noted below.
From what I can tell the recommended way to specify the options is to use the NSWindowDelegate window:willUseFullScreenPresentationOptions: but this didn't seem to have an easy way to access the allowMenusAndBars, it also didn't appear to properly respect the option to hide the dock (although hiding the menu worked the dock would remain in auto hide mode).
That's odd. Yes I have and I've just double checked and it compiles fine. I left out adding the selector part to JuceNSWindow class as I wasn't sure I was encoding things exactly right and figured you'd know how to fill that in properly. But leaving that out doesn't affect the compilation. The selector is only available in 10.7+ so it could probably use a check with that and the NSApp setPresentationOptions is 10.6 I believe.
This is how added the selector to JuceNSWindowClass:
I'm not sure what to say about it. It works on my machine. I'm testing it right now. If I remove the addMethod part the callback is NOT made. If I put it back in the callback IS made. Even switching to your addMethod works with the static method as I have it. I can't explain it..but I'm certainly not claiming that my way is right. That's why I left that part out...I didn't want to suggest doing it wrong and figured you'd know how to fill in the pieces properly.
Because every other callback uses owner to provide the implementation and I thought you'd appreciate the consistency. Because there's something to be said for implementation logic to be free from platform wiring. That's my opinion but beyond that I'm fine with whatever you decide to do!
Ah yeah no major reason. I'm currently debugging why isMouseOver seems to sometimes incorrectly return false and I've got a bunch of dbg statements in the JUCE code, but I'll update when I get finished and let you know. Thanks, much appreciated!