How to set default non-full screen size?

So I want an app to open up with setFullScreen(true), but I want to set the size that the app switches to when the user clicks off the maximise button.

I figure I could just do something like:

setBounds(100, 100, 800, 600); // numbers picked from thin air
setFullScreen(true);

as this should set the app size, and then maximise it.

What actually happens is that when the user clicks off the maximise button, the app instead resizes to some weird set of values that JUCE apparently plucks from thin air. More annoying the window is actually set to be smaller than my min constraints.

Another minor annoyance is that if the window is already at its maximum size, but isFullScreen is false, it is impossible to setFullScreen(true).

I think it’ll only remember the size you pass into setBounds if the window is visible at the time, so you could try that.

Or you could use the ResizableWindow::restoreWindowStateFromString() to do it - if you pass in a string “fs 100 100 500 500” it’ll be fullscreen, but will return to (100, 100 500, 500) when you un-fullscreen it.

I’ll check out the other prob with it not fullscreening when the size is the same, too…