-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from peterklingelhofer/bugfix/Sequoia_close_in…
…itial_extra_settings_window Initial view with key commands closes immediately
- Loading branch information
Showing
4 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// EmptyClosingView.swift | ||
import SwiftUI | ||
|
||
struct EmptyClosingView: NSViewRepresentable { | ||
func makeNSView(context: Context) -> NSView { | ||
let view = SelfClosingView() | ||
return view | ||
} | ||
|
||
func updateNSView(_ nsView: NSView, context: Context) {} | ||
|
||
class SelfClosingView: NSView { | ||
override func viewDidMoveToWindow() { | ||
super.viewDidMoveToWindow() | ||
DispatchQueue.main.async { | ||
if let window = self.window { | ||
window.close() | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters