From 21b91adf6a060d0f6b4f76bce616dac7bd42469b Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 2 Oct 2016 00:10:09 +0300 Subject: [PATCH] Improved open-dialog behavior in Cocoa --- Cocoa/AppDelegate.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Cocoa/AppDelegate.m b/Cocoa/AppDelegate.m index a03b062..ff98f3f 100644 --- a/Cocoa/AppDelegate.m +++ b/Cocoa/AppDelegate.m @@ -53,11 +53,10 @@ [_preferencesWindow makeKeyAndOrderFront:self]; } -- (void)applicationDidBecomeActive:(NSNotification *)notification +- (BOOL)applicationOpenUntitledFile:(NSApplication *)sender { - NSDocumentController *controller = [NSDocumentController sharedDocumentController]; - if (![[controller documents] count]) { - [[NSDocumentController sharedDocumentController] openDocument:self]; - } + [[NSDocumentController sharedDocumentController] openDocument:self]; + return YES; } + @end