diff --git a/OSBindings/Mac/Clock Signal/AppDelegate.swift b/OSBindings/Mac/Clock Signal/AppDelegate.swift index c8e4b750b..a29848aa2 100644 --- a/OSBindings/Mac/Clock Signal/AppDelegate.swift +++ b/OSBindings/Mac/Clock Signal/AppDelegate.swift @@ -13,6 +13,10 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application. + + if NSDocumentController.shared.documents.count == 0 { + NSDocumentController.shared.openDocument(self) + } } func applicationWillTerminate(_ aNotification: Notification) { @@ -20,13 +24,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { } func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool { - // Decline to show the 'New...' selector by default, preferring to offer - // an 'Open...' dialogue. + // Decline to show the 'New...' selector by default; the 'Open...' + // dialogue has already been shown if this application was started + // without a file. // // Obiter: I dislike it when other applications do this for me, but it // seems to be the new norm, and I've had user feedback that showing // nothing is confusing. So here it is. - NSDocumentController.shared.openDocument(self) return false } }