Repo // Enforce NSApp.activate() instead.
This commit is contained in:
parent
94105ccc9b
commit
63d56d8132
|
@ -112,7 +112,7 @@ public class UpdateSputnik {
|
||||||
alert.informativeText = NSLocalizedString("You are already using the latest version.", comment: "")
|
alert.informativeText = NSLocalizedString("You are already using the latest version.", comment: "")
|
||||||
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
||||||
alert.runModal()
|
alert.runModal()
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,8 +131,8 @@ public class UpdateSputnik {
|
||||||
alert.informativeText = content
|
alert.informativeText = content
|
||||||
alert.addButton(withTitle: NSLocalizedString("Visit Website", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("Visit Website", comment: ""))
|
||||||
alert.addButton(withTitle: NSLocalizedString("Not Now", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("Not Now", comment: ""))
|
||||||
NSApp.setActivationPolicy(.accessory)
|
|
||||||
let result = alert.runModal()
|
let result = alert.runModal()
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
||||||
if let siteInfoURLString = plist[varkUpdateInfoPageURLKey] as? String,
|
if let siteInfoURLString = plist[varkUpdateInfoPageURLKey] as? String,
|
||||||
let siteURL = URL(string: siteInfoURLString)
|
let siteURL = URL(string: siteInfoURLString)
|
||||||
|
@ -158,6 +158,6 @@ public class UpdateSputnik {
|
||||||
alert.informativeText = content
|
alert.informativeText = content
|
||||||
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
||||||
alert.runModal()
|
alert.runModal()
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,7 @@ extension AppDelegate {
|
||||||
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
||||||
alert.addButton(withTitle: NSLocalizedString("Not Now", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("Not Now", comment: ""))
|
||||||
let result = alert.runModal()
|
let result = alert.runModal()
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
||||||
NSWorkspace.shared.openFile(
|
NSWorkspace.shared.openFile(
|
||||||
LMMgr.dataFolderPath(isDefaultFolder: true), withApplication: "Finder"
|
LMMgr.dataFolderPath(isDefaultFolder: true), withApplication: "Finder"
|
||||||
|
@ -104,7 +105,6 @@ extension AppDelegate {
|
||||||
isSudo: false, selfKill: true, defaultDataFolderPath: LMMgr.dataFolderPath(isDefaultFolder: true)
|
isSudo: false, selfKill: true, defaultDataFolderPath: LMMgr.dataFolderPath(isDefaultFolder: true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
NSApp.setActivationPolicy(.accessory)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 檢查該程式本身的記憶體佔用量。
|
/// 檢查該程式本身的記憶體佔用量。
|
||||||
|
|
|
@ -611,7 +611,7 @@ public enum LMMgr {
|
||||||
alert.informativeText = content
|
alert.informativeText = content
|
||||||
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
||||||
alert.runModal()
|
alert.runModal()
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,11 +204,10 @@ extension SessionCtl {
|
||||||
} else if NSEvent.modifierFlags.contains(.option) {
|
} else if NSEvent.modifierFlags.contains(.option) {
|
||||||
CtlPrefWindow.show()
|
CtlPrefWindow.show()
|
||||||
} else {
|
} else {
|
||||||
NSApp.setActivationPolicy(.accessory)
|
|
||||||
CtlPrefUI.shared.controller.show(preferencePane: SSPreferences.PaneIdentifier(rawValue: "General"))
|
CtlPrefUI.shared.controller.show(preferencePane: SSPreferences.PaneIdentifier(rawValue: "General"))
|
||||||
CtlPrefUI.shared.controller.window?.level = .statusBar
|
CtlPrefUI.shared.controller.window?.level = .statusBar
|
||||||
NSApp.activate(ignoringOtherApps: true)
|
|
||||||
}
|
}
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc public func showCheatSheet(_: Any? = nil) {
|
@objc public func showCheatSheet(_: Any? = nil) {
|
||||||
|
@ -233,11 +232,11 @@ extension SessionCtl {
|
||||||
"Please reconfigure the cassette path to a valid one before enabling this mode.", comment: ""
|
"Please reconfigure the cassette path to a valid one before enabling this mode.", comment: ""
|
||||||
)
|
)
|
||||||
let result = alert.runModal()
|
let result = alert.runModal()
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
if result == NSApplication.ModalResponse.alertFirstButtonReturn {
|
||||||
LMMgr.resetCassettePath()
|
LMMgr.resetCassettePath()
|
||||||
PrefMgr.shared.cassetteEnabled = false
|
PrefMgr.shared.cassetteEnabled = false
|
||||||
}
|
}
|
||||||
NSApp.setActivationPolicy(.accessory)
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ class CtlAboutWindow: NSWindowController {
|
||||||
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
||||||
sharedWindow.level = .statusBar
|
sharedWindow.level = .statusBar
|
||||||
sharedWindow.titlebarAppearsTransparent = true
|
sharedWindow.titlebarAppearsTransparent = true
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func windowDidLoad() {
|
override func windowDidLoad() {
|
||||||
|
|
|
@ -23,7 +23,7 @@ class CtlClientListMgr: NSWindowController, NSTableViewDelegate, NSTableViewData
|
||||||
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
||||||
sharedWindow.level = .statusBar
|
sharedWindow.level = .statusBar
|
||||||
sharedWindow.titlebarAppearsTransparent = true
|
sharedWindow.titlebarAppearsTransparent = true
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func windowDidLoad() {
|
override func windowDidLoad() {
|
||||||
|
|
|
@ -54,7 +54,7 @@ class CtlPrefWindow: NSWindowController {
|
||||||
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
||||||
sharedWindow.level = .statusBar
|
sharedWindow.level = .statusBar
|
||||||
sharedWindow.titlebarAppearsTransparent = true
|
sharedWindow.titlebarAppearsTransparent = true
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var currentLanguageSelectItem: NSMenuItem?
|
private var currentLanguageSelectItem: NSMenuItem?
|
||||||
|
|
|
@ -22,7 +22,7 @@ import Cocoa
|
||||||
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
sharedWindow.orderFrontRegardless() // 逼著視窗往最前方顯示
|
||||||
sharedWindow.level = .statusBar
|
sharedWindow.level = .statusBar
|
||||||
sharedWindow.titlebarAppearsTransparent = true
|
sharedWindow.titlebarAppearsTransparent = true
|
||||||
NSApp.setActivationPolicy(.accessory)
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func windowDidLoad() {
|
override func windowDidLoad() {
|
||||||
|
|
Loading…
Reference in New Issue