From 01aa0dbdc322ec4d4beff77cbba54e7770d19f53 Mon Sep 17 00:00:00 2001 From: wlux Date: Mon, 3 Sep 2012 13:24:03 +0000 Subject: [PATCH] Fix bug where the -_screenForFrame: method was returning nil when the frame had zero width or height. This could destroy a valid screen attribute of a window. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35502 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSWindow.m | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9a0911c45..67a7bf00c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-03 Wolfgang Lux + + * Source/NSWindow.m (_screenForFrame:): Fix bug where this method + was returning nil when the frame had zero width or height. This + could destroy a valid screen attribute of a window. + 2012-09-02 German A. Arias * Source/GSToolTips.m (_timedOut:): Don't display the tooltip diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 793ffab5e..a3beb3f91 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -388,7 +388,7 @@ has blocked and waited for events. */ - (NSScreen *) _screenForFrame: (NSRect)frame { - NSInteger largest = 0; + NSInteger largest = -1; NSArray *screens = [NSScreen screens]; NSInteger index = 0; NSScreen *theScreen = nil;