Skip to content

Commit e84154c

Browse files
committed
Maybe open a new window when clicking on dock icon
1 parent d053c60 commit e84154c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

devdocs-macos/AppDelegate.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2828
DocumentationWindows.shared.persist()
2929
}
3030

31+
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
32+
if flag {
33+
return false
34+
} else {
35+
DocumentationWindows.shared.newWindow()
36+
return true
37+
}
38+
}
39+
3140
@IBAction func newTab(_ sender: Any) {
3241
DocumentationWindows.shared.newWindow()
3342
}

0 commit comments

Comments
 (0)