Skip to content

Commit

Permalink
Not present recent if one of document had been opened already
Browse files Browse the repository at this point in the history
  • Loading branch information
akaDuality committed Jan 2, 2024
1 parent a217897 commit f64b966
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions VoiceOver Designer/Documents/WindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,24 @@ class WindowManager: NSObject {
private var projectController: ProjectController?

func start() {
print("Start")

// This method is called from applicationDidFinishLaunching
// This place is too early to restore any previous opened windows
// As a result we had to slightly wait to check what is restored
// In there in no other windows – show recent or new
//
// It can be fixed by finding correct place. Maybe NSApplicationDidFinishRestoringWindowsNotification will help?
DispatchQueue.main.async {
self.showRecentIfNeeded()
}
}

private func showRecentIfNeeded() {
if newDocumentIsCreated {
// Document has been created from [NSDocumentController openUntitledDocumentAndDisplay:error:]
return
}
if documentsPresenter.shouldShowThisController {
self.showRecent()
showRecent()
} else {
// TODO: Do we need it or document will open automatically?
showNewDocument()
Expand Down

0 comments on commit f64b966

Please sign in to comment.