Constrain windows that are off bottom of screen also.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14695 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-10-10 03:10:31 +00:00
parent 323e056230
commit d9dda82498
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2002-08-30 Georg Fleischmann
* Source/NSWindow.m ([-constrainFrameRect]): Move window inside
screen, if window top is below screen.
2002-10-09 Adam Fedor <fedor@gnu.org>
* Source/NSApplication (hide:): Don't setinputfocus to the

View file

@ -1321,7 +1321,7 @@ static NSNotificationCenter *nc = nil;
/* Windows need to be constrained when displayed or resized - but only
titled windows are constrained. Also, and this is the tricky part,
don't constrain if we are merely unhidding the window or if it's
already visible and is just begin reordered. */
already visible and is just being reordered. */
if ((_styleMask & NSTitledWindowMask)
&& [NSApp isHidden] == NO
&& _f.visible == NO)
@ -1517,7 +1517,14 @@ static NSNotificationCenter *nc = nil;
{
frameRect.origin.y -= difference;
}
else if (NSMaxY (frameRect) < NSMinY (screenRect))
{
float diff1 = NSMinY (frameRect) - NSMinY (screenRect);
/* move bottom inside the screen, but keep top inside screen */
frameRect.origin.y -= MAX(difference, diff1);
difference = NSMaxY (frameRect) - NSMaxY (screenRect);
}
/* If the window is resizable, resize it (if needed) so that the
bottom edge is on the screen too */
if (_styleMask & NSResizableWindowMask)