Kiosk Mode Issues

I have a couple of issues with the way kiosk mode works on OSX. This is with the tip from last night and OSX 10.6.5. All this behaviour happens with the latest juce demo as well.

The dock & menu bar still pop-up when mousing to the edge of the screen when calling setKioskModeComponent(comp, false)

Should this line in the component peer read something like: (untested)

It is hard coded in the native component peer code that when a component loses focus it also exits kiosk mode. Whilst I can see this as somewhat expected behaviour it isn’t necessarily standard for all applications and in my instance definitely unwanted. Think about when using Spaces on the Mac. It is perfectly reasonable to keep an app full screen on one space then switch to other spaces while it still runs and later return to it still being fullscreen. I actually do this on a day to day basis with a couple of apps.

The last thing is that you can’t check to see if your component is coming out of kiosk mode for example in resized(). I think this is because the kioskModeComponent is not updated until after the call to setBounds in Desktop::setKioskModeComponent(). Could this be set up so we can check this correctly or have some kind of listener interface so we can set our own flags?

(Btw on a side note loving the component transforms, it lets me do some things i’ve wanted for nearly a year so simply without having to re-implement entire juce classes, nice one).

Thanks, interesting points. I’ll have to have a play with it, as I’ve not really spent much time using kiosk mode (I haven’t actually written an app that uses it for real). I’ve also never even turned on spaces on OSX, which I also should do…

Hi Jules, thanks for the 10.6 update for this however, it doesn’t work as the docs say it does. There’s no reference to allowMenusAndBars in the 10.6 section and it doesn’t work properly for 10.5 and below either. I have amended my source as follows and now it behaves properly no matter what the target:

void juce_setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool allowMenusAndBars) { #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 if (enableOrDisable) { [NSApp setPresentationOptions: (allowMenusAndBars ? (NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar) : (NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar))]; kioskModeComponent->setBounds (Desktop::getInstance().getMainMonitorArea (false)); } else { [NSApp setPresentationOptions: NSApplicationPresentationDefault]; } #else if (enableOrDisable) { SetSystemUIMode (allowMenusAndBars ? kUIModeAllSuppressed : kUIModeAllHidden, 0); kioskModeComponent->setBounds (Desktop::getInstance().getMainMonitorArea (false)); } else { SetSystemUIMode (kUIModeNormal, 0); } #endif }

Ah yes, sorry - not sure how I managed to forget that! Will have another look…