From 346f604cb71536fc3fc8259816ca33737d3f39de Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 19 Apr 2011 08:23:01 +0000 Subject: [PATCH] * Source/NSWindow.m: Remove unnecessary FIXMEs related to user space scale factor * Source/NSAppliation.m: Correct app icon sizing which was mixing up window frame coordinates and user space coordinates * Source/NSCachedImageRep.m: Add NSUnscaledWindowMask to the window used internally git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32897 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Source/NSApplication.m | 19 ++++++++++++------- Source/NSCachedImageRep.m | 4 ++-- Source/NSWindow.m | 2 -- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10d6e011d..a3b28b2e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-04-18 Eric Wasylishen + + * Source/NSWindow.m: Remove unnecessary FIXMEs related to + user space scale factor + * Source/NSAppliation.m: Correct app icon sizing which was + mixing up window frame coordinates and user space coordinates + * Source/NSCachedImageRep.m: Add NSUnscaledWindowMask to the + window used internally + 2011-04-18 Eric Wasylishen * Source/NSScreen.m (-userSpaceScaleFactor): diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 117c2ff9e..fbab60ebd 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -3761,7 +3761,6 @@ struct _DelegateWrapper - _appIconInit { NSAppIconView *iv; - NSRect iconRect; unsigned mask = NSIconWindowMask; BOOL suppress; @@ -3780,13 +3779,19 @@ struct _DelegateWrapper defer: NO screen: nil]; - iconRect = GSGetIconFrame(_app_icon_window); - [_app_icon_window setFrame: iconRect display: YES]; - iv = [[NSAppIconView alloc] initWithFrame: iconRect]; - [iv setImage: _app_icon]; - [_app_icon_window setContentView: iv]; - RELEASE(iv); + + { + NSRect iconContentRect = GSGetIconFrame(_app_icon_window); + NSRect iconFrame = [_app_icon_window frameRectForContentRect: iconContentRect]; + NSRect iconViewFrame = NSMakeRect(0, 0, iconContentRect.size.width, iconContentRect.size.height); + [_app_icon_window setFrame: iconFrame display: YES]; + + iv = [[NSAppIconView alloc] initWithFrame: iconViewFrame]; + [iv setImage: _app_icon]; + [_app_icon_window setContentView: iv]; + RELEASE(iv); + } if (NO == suppress) { diff --git a/Source/NSCachedImageRep.m b/Source/NSCachedImageRep.m index ff504f173..ba57bba8c 100644 --- a/Source/NSCachedImageRep.m +++ b/Source/NSCachedImageRep.m @@ -92,7 +92,7 @@ frame.origin = NSMakePoint(0,0); frame.size = aSize; win = [[GSCacheW alloc] initWithContentRect: frame - styleMask: NSBorderlessWindowMask + styleMask: NSBorderlessWindowMask | NSUnscaledWindowMask backing: NSBackingStoreRetained defer: NO]; self = [self initWithWindow: win rect: frame]; @@ -136,7 +136,7 @@ } if (!_window) _window = [[GSCacheW alloc] initWithContentRect: _rect - styleMask: NSBorderlessWindowMask + styleMask: NSBorderlessWindowMask | NSUnscaledWindowMask backing: NSBackingStoreRetained defer: NO]; [self setSize: _rect.size]; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 163a5d1cb..7e417a953 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -2272,7 +2272,6 @@ many times. */ - (NSPoint) convertBaseToScreen: (NSPoint)aPoint { - // FIXME: Apply userSpaceScaleFactor? NSPoint screenPoint; screenPoint.x = _frame.origin.x + aPoint.x; @@ -2286,7 +2285,6 @@ many times. */ - (NSPoint) convertScreenToBase: (NSPoint)aPoint { - // FIXME: Apply userSpaceScaleFactor? NSPoint basePoint; basePoint.x = aPoint.x - _frame.origin.x;