Try to compensate for changes in screen size.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16545 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-04-26 06:39:49 +00:00
parent 22413442fa
commit 15aab01ceb
2 changed files with 26 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2003-04-26 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSWindow.m: ([setFrameFromString:]) try to adjust sensibly
for changes to screen size.
2003-04-26 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPanel.m

View file

@ -3625,12 +3625,29 @@ Code shared with [NSPanel -sendEvent:], remember to update both places.
nRect = [[self screen] visibleFrame];
/*
* FIXME - if the stored screen area is not the same as that currently
* available, we should probably adjust the window frame (position) in
* some way to try to make layout sensible.
* If the new screen drawable area has moved relative to the one in
* which the window was saved, adjust the window position accordingly.
*/
if (NSEqualRects(nRect, sRect) == NO)
if (NSEqualPoints(nRect.origin, sRect.origin) == NO)
{
fRect.origin.x += nRect.origin.x - sRect.origin.x;
fRect.origin.y += nRect.origin.y - sRect.origin.y;
}
/*
* If the stored screen area is not the same as that currently
* available, we adjust the window frame (position) to try to
* make layout sensible.
*/
if (nRect.size.width != sRect.size.width)
{
fRect.origin.x = nRect.origin.x + (fRect.origin.x - nRect.origin.x)
* (nRect.size.width / sRect.size.width);
}
if (nRect.size.height != sRect.size.height)
{
fRect.origin.y = nRect.origin.y + (fRect.origin.y - nRect.origin.y)
* (nRect.size.height / sRect.size.height);
}
/*