Skip to content

Commit

Permalink
NSSaveDialog now pops in front
Browse files Browse the repository at this point in the history
NSSaveDialog now pops in front of everything. Fixed order of how it's called.
  • Loading branch information
boberito committed Mar 6, 2024
1 parent ad3e6cb commit 816d6e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Binary file not shown.
17 changes: 11 additions & 6 deletions smartcard_menu/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
accessoryView.addSubview(formatPopup)
accessoryView.addSubview(certsPopUpLabel)
savePanel.accessoryView = accessoryView

savePanel.begin(completionHandler: { response in
if #available(OSX 14.0, *) {
NSApp.activate()
} else {
NSApp.activate(ignoringOtherApps: true)
}
savePanel.makeKeyAndOrderFront(savePanel)


if response.rawValue != 0 {

do {
Expand All @@ -302,6 +299,14 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
})
savePanel.makeKeyAndOrderFront(savePanel)
savePanel.orderFrontRegardless()
if #available(OSX 14.0, *) {
NSApp.activate()
} else {
NSApp.activate(ignoringOtherApps: true)
}

}
@objc func certSelected(_ sender: NSMenuItem) {
let selectedCert = sender.representedObject as! SecIdentity
Expand Down

0 comments on commit 816d6e9

Please sign in to comment.