Fullscreen mode when using native title bar

In Mac OSX, after doing the following on a DocumentWindow:


The window is maximized, but the title bar is hidden behind the OSX menu bar. This is strange because users cannot move/restore the window anymore.
However, by clicking the maximize button on the title bar, it’s fine.

So my question is there a programmatic way to perform a maximize?

It doesn’t do that at the moment but probably should do… Maybe something like this:

[code]void NSViewComponentPeer::setFullScreen (bool shouldBeFullScreen)
if (! isSharedWindow)
Rectangle r (lastNonFullscreenBounds);

    setMinimised (false);

    if (fullScreen != shouldBeFullScreen)
        if (shouldBeFullScreen && (getStyleFlags() & windowHasTitleBar) != 0)
            fullScreen = true;
            [window performZoom: nil];
            if (shouldBeFullScreen)
                r = Desktop::getInstance().getMainMonitorArea();

            // (can't call the component's setBounds method because that'll reset our fullscreen flag)
            if (r != getComponent()->getBounds() && ! r.isEmpty())
                setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight(), shouldBeFullScreen);