fullScreen vs kioskMode


I’d like to use kioskMode instead of fullScreen mode on a window application: I’d like to activate kioskMode when the maximise button is pressed, and go back to a windowed mode when pressing again the maximise button.

The only way I’ve found of doing this - at least on Windows - is modifying ResizableWindow so setFullScreen and isFullScreen are virtual, and implementing these methods in the window code.

Which gives something of the sort with the Juce Demo window:

void MainDemoWindow::setFullScreen (bool shouldBeFullScreen)
    m_isFullScreen = shouldBeFullScreen;

    Desktop& desktop = Desktop::getInstance();

    if ( shouldBeFullScreen )
        DocumentWindow::setFullScreen (true);
        desktop.setKioskModeComponent (this);

        setResizable (false, true);
        desktop.setKioskModeComponent (NULL);

        setResizable(true, true);

        DocumentWindow::setFullScreen (false);

bool MainDemoWindow::isFullScreen() const
    return m_isFullScreen;

Implementing isFullScreen() is necessary for the maximise button to be toggled correctly, and the setResizable calls are there so that the kiosk mode is not resizable.

Is there another cleaner way of implementing this? without modifying Juce code?

Thanks! -Mathieu