I have an issue with restoreWindowStateFromString in a special case:
I'm running on Window 7 64 Pro US SP1.
(my GPU JFYI: AMD FirePro V5900 with v13.352 driver.)
I'm running my application in multiple display.
When getWindowStateAsString is called it was maximized on a screen that do not own the (0, 0) coordinate of the desktop.
If I use the restoreWindowStateFromString with this state, It is correctly restored in maximized state but on the bad screen.
To fix this I modify the ResizableWindow class like this :
bool ResizableWindow::restoreWindowStateFromString (const String& s)
{
[...]
if (peer != nullptr)
{
peer->getFrameSize().subtractFrom (newPos);
peer->setNonFullScreenBounds (newPos);
}
// alexdlabs: do not try overwrite last non full screen user bounds.
// this help user to retrieve its non maximised bounds when it disable maximised mode.
//updateLastPosIfNotFullScreen();
// alexdlabs: delay full screen setting after bound was set.
//setFullScreen (fs);
// alexdlabs: always use user bounds
//if (! fs)
setBoundsConstrained (newPos);
// alexdlabs: always restore full screen state after setBoundsConstrained
setFullScreen (fs);
return true;
}
I'm using last Juce version compiled with Visual Studio 2010 SP1 in 64 bit.
It's working except when exiting fullscreen mode, the application restore the bounds set by
updateLastPosIfNotFullScreen (screen owning 0,0 instead of the maximized screen)
perapse we should change the prototype like this: updateLastPosIfNotFullScreen(newPos);
or reoder like this:
if (fs)
setBoundsConstrained (newPos);
updateLastPosIfNotFullScreen();
setFullScreen (fs);
if (! fs)
setBoundsConstrained (newPos);