IME // Add NSApp.setActivationPolicy(.accessory).
- This ensures application focus when it has a window show up.
This commit is contained in:
parent
8fbbe6d743
commit
e30897a56e
|
@ -200,6 +200,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
ctlPrefWindowInstance?.window?.orderFrontRegardless() // 逼著屬性視窗往最前方顯示
|
ctlPrefWindowInstance?.window?.orderFrontRegardless() // 逼著屬性視窗往最前方顯示
|
||||||
ctlPrefWindowInstance?.window?.level = .statusBar
|
ctlPrefWindowInstance?.window?.level = .statusBar
|
||||||
ctlPrefWindowInstance?.window?.titlebarAppearsTransparent = true
|
ctlPrefWindowInstance?.window?.titlebarAppearsTransparent = true
|
||||||
|
NSApp.setActivationPolicy(.accessory)
|
||||||
}
|
}
|
||||||
|
|
||||||
// New About Window
|
// New About Window
|
||||||
|
@ -210,6 +211,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
ctlAboutWindowInstance?.window?.center()
|
ctlAboutWindowInstance?.window?.center()
|
||||||
ctlAboutWindowInstance?.window?.orderFrontRegardless() // 逼著關於視窗往最前方顯示
|
ctlAboutWindowInstance?.window?.orderFrontRegardless() // 逼著關於視窗往最前方顯示
|
||||||
ctlAboutWindowInstance?.window?.level = .statusBar
|
ctlAboutWindowInstance?.window?.level = .statusBar
|
||||||
|
NSApp.setActivationPolicy(.accessory)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc(checkForUpdate)
|
@objc(checkForUpdate)
|
||||||
|
@ -257,6 +259,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
report.versionDescription)
|
report.versionDescription)
|
||||||
IME.prtDebugIntel("vChewingDebug: \(content)")
|
IME.prtDebugIntel("vChewingDebug: \(content)")
|
||||||
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("New Version Available", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("Visit Website", comment: ""), cancelButtonTitle: NSLocalizedString("Not Now", comment: ""), cancelAsDefault: false, delegate: self)
|
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("New Version Available", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("Visit Website", comment: ""), cancelButtonTitle: NSLocalizedString("Not Now", comment: ""), cancelAsDefault: false, delegate: self)
|
||||||
|
NSApp.setActivationPolicy(.accessory)
|
||||||
case .noNeedToUpdate, .ignored:
|
case .noNeedToUpdate, .ignored:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -268,6 +271,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, ctlNonModalAlertWindowDelega
|
||||||
let buttonTitle = NSLocalizedString("Dismiss", comment: "")
|
let buttonTitle = NSLocalizedString("Dismiss", comment: "")
|
||||||
IME.prtDebugIntel("vChewingDebug: \(content)")
|
IME.prtDebugIntel("vChewingDebug: \(content)")
|
||||||
ctlNonModalAlertWindow.shared.show(title: title, content: content, confirmButtonTitle: buttonTitle, cancelButtonTitle: nil, cancelAsDefault: false, delegate: nil)
|
ctlNonModalAlertWindow.shared.show(title: title, content: content, confirmButtonTitle: buttonTitle, cancelButtonTitle: nil, cancelAsDefault: false, delegate: nil)
|
||||||
|
NSApp.setActivationPolicy(.accessory)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,6 +282,7 @@ class ctlInputMethod: IMKInputController {
|
||||||
if !mgrLangModel.checkIfUserLanguageModelFilesExist() {
|
if !mgrLangModel.checkIfUserLanguageModelFilesExist() {
|
||||||
let content = String(format: NSLocalizedString("Please check the permission at \"%@\".", comment: ""), mgrLangModel.dataFolderPath)
|
let content = String(format: NSLocalizedString("Please check the permission at \"%@\".", comment: ""), mgrLangModel.dataFolderPath)
|
||||||
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("Unable to create the user phrase file.", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("OK", comment: ""), cancelButtonTitle: nil, cancelAsDefault: false, delegate: nil)
|
ctlNonModalAlertWindow.shared.show(title: NSLocalizedString("Unable to create the user phrase file.", comment: ""), content: content, confirmButtonTitle: NSLocalizedString("OK", comment: ""), cancelButtonTitle: nil, cancelAsDefault: false, delegate: nil)
|
||||||
|
NSApp.setActivationPolicy(.accessory)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue