Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions Source/NSApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -3667,7 +3667,10 @@ - (void) replyToApplicationShouldTerminate: (BOOL)shouldTerminate

_app_is_running = NO;

GSRemoveIcon(_app_icon_window);
if (_app_icon_window != nil)
{
GSRemoveIcon(_app_icon_window);
}
[[self windows] makeObjectsPerformSelector: @selector(close)];
[NSCursor setHiddenUntilMouseMoves: NO];

Expand Down Expand Up @@ -4004,20 +4007,16 @@ - (void) _loadAppIconImage

- (void) _appIconInit
{
NSAppIconView *iv;
NSUInteger mask = NSIconWindowMask;
BOOL suppress;

suppress = [[NSUserDefaults standardUserDefaults]
boolForKey: @"GSSuppressAppIcon"];
#if MINI_ICON
if (suppress)
if ([[[NSUserDefaults standardUserDefaults]
objectForKey: @"GSSuppressAppIcon"] isEqual: [NSNumber numberWithBool:NO]] == NO)
{
mask = NSMiniaturizableWindowMask;
return;
}
#endif

_app_icon_window = [[NSIconWindow alloc] initWithContentRect: NSZeroRect

NSAppIconView *iv;
NSUInteger mask = NSIconWindowMask;

_app_icon_window = [[NSIconWindow alloc] initWithContentRect: NSZeroRect
styleMask: mask
backing: NSBackingStoreRetained
defer: NO
Expand All @@ -4043,12 +4042,9 @@ - (void) _appIconInit
RELEASE(iv);
}

if (NO == suppress)
{
/* The icon window is not suppressed ... display it.
*/
[_app_icon_window orderFrontRegardless];
}
/* The icon window is not suppressed ... display it.
*/
[_app_icon_window orderFrontRegardless];
}

- (NSDictionary*) _notificationUserInfo
Expand Down
34 changes: 19 additions & 15 deletions Source/NSWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -3423,21 +3423,25 @@ - (void) miniaturize: (id)sender
*/
if (_counterpart == 0 && [srv appOwnsMiniwindow])
{
NSWindow *mini;
NSMiniWindowView *v;
NSRect rect = NSMakeRect(0, 0, iconSize.height, iconSize.width);

mini = [[NSMiniWindow alloc] initWithContentRect: rect
styleMask: NSMiniWindowMask
backing: NSBackingStoreBuffered
defer: NO];
mini->_counterpart = [self windowNumber];
_counterpart = [mini windowNumber];
v = [[NSMiniWindowView alloc] initWithFrame: rect];
[v setImage: [self miniwindowImage]];
[v setTitle: [self miniwindowTitle]];
[mini setContentView: v];
RELEASE(v);
if ([[[NSUserDefaults standardUserDefaults]
objectForKey: @"GSSuppressAppIcon"] isEqual: [NSNumber numberWithBool:NO]])
{
NSWindow *mini;
NSMiniWindowView *v;
NSRect rect = NSMakeRect(0, 0, iconSize.height, iconSize.width);

mini = [[NSMiniWindow alloc] initWithContentRect: rect
styleMask: NSMiniWindowMask
backing: NSBackingStoreBuffered
defer: NO];
mini->_counterpart = [self windowNumber];
_counterpart = [mini windowNumber];
v = [[NSMiniWindowView alloc] initWithFrame: rect];
[v setImage: [self miniwindowImage]];
[v setTitle: [self miniwindowTitle]];
[mini setContentView: v];
RELEASE(v);
}
}
[self _lossOfKeyOrMainWindow];
[srv miniwindow: _windowNum];
Expand Down
16 changes: 14 additions & 2 deletions Tests/gui/NSFontManager/convert.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
#define EQ(a, b) (fabs((double)(a) - (double)(b)) < 0.001)

int
main(int argc, char **argv)
main(int argc, char **argv, char **env)
{
GSInitializeProcess(argc, argv, env);
CREATE_AUTORELEASE_POOL(arp);

START_SET("convertFont:toSize:")

NS_DURING
Expand All @@ -32,7 +35,15 @@
NS_DURING
{
NSFontManager *fm = [NSFontManager sharedFontManager];
NSFont *h24 = [NSFont fontWithName: @"Helvetica" size: 24.0];
NSArray *available = [fm availableFonts];
NSString *fontName = [available count] > 0
? [available objectAtIndex: 0] : nil;
NSFont *h24 = fontName != nil
? [NSFont fontWithName: fontName size: 24.0] : nil;

if (fontName == nil || h24 == nil)
SKIP("No installed font is available to test font conversion")

NSFont *h12 = [fm convertFont: h24 toSize: 12.0];
NSFont *same = [fm convertFont: h24 toSize: 24.0];

Expand All @@ -48,5 +59,6 @@
NS_ENDHANDLER

END_SET("convertFont:toSize:")
RELEASE(arp);
return 0;
}