ResizableWindow::restoreWindowStateFromString problem


#1

Hi Jules, just a heads up on restoreWindowStateFromString: Let’s say your using an application on a Mac with two monitors, one large widescreen 24" and the main Mac one, resize the application (on the 24") so that its well larger than the main Mac monitor, shut down the application (stores the settings), unhook the 24" monitor and start the application which will then reside on the Mac monitor which then won’t be able to “hold” the application, making it impossible to move or resize the window. Right now I check the getParentMonitorArea to work around this, but I think that should reside in restoreWindowStateFromString…


#2

Thanks - how about this, in restoreWindowStateFromString

    Rectangle r (tokens[n].getIntValue(),
                 tokens[n + 1].getIntValue(),
                 tokens[n + 2].getIntValue(),
                 tokens[n + 3].getIntValue());

    if (r.isEmpty())
        return false;

    const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (r.getX(), r.getY()));

    r = r.getIntersection (screen);

    lastNonFullScreenPos = r;

#3

[quote=“jules”]Thanks - how about this, in restoreWindowStateFromString

[code]
Rectangle r (tokens[n].getIntValue(),
tokens[n + 1].getIntValue(),
tokens[n + 2].getIntValue(),
tokens[n + 3].getIntValue());

if (r.isEmpty())
    return false;

const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (r.getX(), r.getY()));

r = r.getIntersection (screen);

lastNonFullScreenPos = r;

[/code][/quote]

Niice. Should do it nicely, thnx!