Resizable Border oddness on Mac

We have avoided a full resizable border since (AFAIK) it needs to be visible, creating an actual border around our app. I can set the border width to 1, which looks fine, but is annoyingly difficult to ‘catch’ with the mouse pointer. So we’ve always used a resizable corner, and a custom titleBar.

If we use the native title bar, we get (I assume) the system supplied window which has resizing built in to every window edge without the need for the unsightly visible border. But the title bar itself is nasty.

I have just noticed since updating to JUCE6 that if I make my app fullscreen, then not-fullscreen, the Mac-style resize handles are suddenly available. best of both worlds, but it has to be done manually by the user.

So does anyone understand how/why this is happening? It would be great if we could harness this Mac-style resize border without the need for the visible 4px JUCE border.

Thank you for reporting this. The inconsistent behaviour has now been fixed on develop

I looked into the possibility of enabling this behaviour on demand, but it seemed too problematic on Windows and Linux.

On MacOS triggering this behaviour would be as simple as using the following, custom window class. This however relies on overriding an internal, albeit public function. Hence this approach can break in any future JUCE release without warning.

struct WindowWithNativeResizers : public juce::DocumentWindow
{
    using DocumentWindow::DocumentWindow;

    int getDesktopWindowStyleFlags() const override
    {
        const auto flags = DocumentWindow::getDesktopWindowStyleFlags();

        if ((juce::SystemStats::getOperatingSystemType() & juce::SystemStats::MacOSX) != 0)
            return flags | juce::ComponentPeer::StyleFlags::windowIsResizable;

        return flags;
    }
};