I don’t think so, this should be easy to fix. I think that just removing the if-statement and always do
if (shouldBeFullScreen != isFullScreen())
[window toggleFullScreen: nil];
It does enter the fullscreen state correctly, but it doesn’t always resize the content component. Another side-effect is that the native titlebar is always available for a fullscreen app on MacOS, so you’ll have two titlebars.
I’ve updated the behaviour for windows with non-native titlebars so that it matches the behaviour of windows with native titlebars. This means that the maximise button now takes non-native windows into fullscreen mode. This behaviour more closely matches the behaviour on Windows and Linux, where the maximise button always makes the window fill the screen, rather than just zooming to the largest size allowed by the window’s bounds constrainer.
Another nice side-effect of this change is that isFullscreen will return true after calling setFullscreen (true) on a window with a non-native titlebar (this was not the case previously).
Thanks - but I’m finding the behaviour is now frustrating users.
On most Mac apps the maximise button puts you into fullscreen, but you can opt-click on it to get the old (preferred) behaviour of maximising to available bounds, leaving the menu bar in place.
Can we add that?
As it is currently, we’re getting weird stuff like: tabbing to another app then tabbing back makes the main UI hidden (somewhere).
We can take a look at this, but because it’s platform-specific behaviour it could be quite awkward to fit into the current API. I can’t promise any timeframe for this.
If you can provide repro steps and affected platforms for these issues, I can take a look. Do you see the same problem in the JUCE DemoRunner or other example projects? In general, regressions like this are treated as higher-priority than new functionality.
Take Projucer as the example (with the native title bar)
If you opt-click on the maximise button you get the old behaviour.
An app with non-native title bar doesn’t have that option.
They ought to be consistent right?
Here’s the frustrating behaviour demonstrated with Projucer:
Make it fullscreen
go to the menu and open another window (UTF-8 String converter)
Where did the main UI go?
App-switch using cmd-tab - then App-switch back,
Still no main window and even “show all windows” doesn’t reveal it.
I realise this is partly a side effect of the way the OS handles fullscreen apps, but it’s such a horrible user experience that we absolutely need a way to offer the traditional “maximise” behaviour.
Here’s what I ended up doing - override maximiseButtonPressed().
Unfortunately the key modifiers from the button press aren’t passed along.
Maybe ButtonListenerProxy::buttonClicked() needs a ModifierKeys argument.