How to maximize window on MacOS

In an older version of JUCE setFullScreen(true) used to actually maximize the window as seen in:

void DocumentWindow::maximiseButtonPressed()
    setFullScreen (! isFullScreen());

It seems like the behaviour for setFullScreen has changed on MacOS compared to other OS though. On windows setFullScreen still causes the window to maximise (not fullscreen) while on Mac it actually goes into full screen mode. What is the new way to maximise windows on MacOS (not fullscreen)? I have tried setting the window to display.userArea bounds but these seem to be incorrect.

There has to be a way to do this right?