Fix to prevent restoring an NSWindowFrame to a completely off-screen location.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29747 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Jonathan Gillaspie 2010-02-25 18:30:10 +00:00
parent 1fd690b848
commit d5cc2fce52

View file

@ -4562,6 +4562,15 @@ current key view.<br />
return;
}
fRect.size.height = value;
/*
* Check that the window will come up on screen
*/
if (fRect.origin.x + fRect.size.width < 0)
{
NSLog(@"Bad screen frame - window is off screen");
return;
}
/*
* Scan in the frame for the area the window was placed in in screen.
@ -4599,7 +4608,7 @@ current key view.<br />
* the window could be placed (ie a rectangle excluding the dock).
*/
nRect = [[self screen] visibleFrame];
/*
* If the new screen drawable area has moved relative to the one in
* which the window was saved, adjust the window position accordingly.