Lion Fullscreen should be considered as fullscreen


#1

so I made the following change:

bool NSViewComponentPeer::isFullScreen() const
{
    if ([window styleMask] & NSFullScreenWindowMask)    //added by Me
        return true;
    else return fullScreen;
}

I was trying to use the getKioskModeComponent to find out if we are in fullscreen, but apparently, the kioskModeComponent is not set when user press the fullscreen button on the title bar.


#2

Seriously?? A naive change like that would break all kinds of unrelated code that relies on the current behaviour of isFullScreen()!


#3

Just kidding. A better to get the fullscreen state is:

void* nsview = window.getPeer()->getNativeHandle
NSView* view = (NSView*)nsview;
bool fullscreen = [view.window styleMask] & NSFullScreenWindowMask;

But anyway, we should setup enter/leave fullscreen notification in order to catch the chance to set kioskModeComponent properly. So we can just use getKioskModeComponent to get the current fullscreen state.


#4

Yes, that makes more sense!


#5

Has something like this been done already? I was pleasantly surprised to see that Lion fullscreen app mode is just working with the latest version of Juce. I’m now looking at how to best coordinate that with a toolbar button that previously used kiosk mode.