From d5cc2fce5260b99bb94ac04e7a09816060bb1d17 Mon Sep 17 00:00:00 2001 From: Jonathan Gillaspie Date: Thu, 25 Feb 2010 18:30:10 +0000 Subject: [PATCH] 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 --- Source/NSWindow.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 977648437..5576ff92b 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -4562,6 +4562,15 @@ current key view.
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.
* 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.