Adjust window position if screen widths are different

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@35768 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2012-10-30 20:47:51 +00:00
parent cdf826a4d0
commit 71738e0dea

View file

@ -4773,6 +4773,7 @@ current key view.<br />
return; return;
} }
sRect.size.height = value; sRect.size.height = value;
#if defined(__MINGW__) #if defined(__MINGW__)
// Finally, this is for handling possible frame errors due to MSWindows sending // Finally, this is for handling possible frame errors due to MSWindows sending
// x/y frame position of -32000/32893 on a minimize. These are now ignored in the // x/y frame position of -32000/32893 on a minimize. These are now ignored in the
@ -4844,6 +4845,14 @@ current key view.<br />
{ {
fRect.origin.x = nRect.origin.x + (fRect.origin.x - nRect.origin.x) fRect.origin.x = nRect.origin.x + (fRect.origin.x - nRect.origin.x)
* (nRect.size.width / sRect.size.width); * (nRect.size.width / sRect.size.width);
/*
* If width of the window goes beyond the screen width, then adjust the window over.
*/
if (NSMaxX(fRect) > nRect.size.width)
{
fRect.origin.x = (nRect.size.width - fRect.size.width);
}
} }
if (nRect.size.height != sRect.size.height) if (nRect.size.height != sRect.size.height)
{ {