Closed YOnoda closed 8 years ago
when you register the shortcut and trigger the registered shortcut to open the app
Could you please be more specific? Maybe show code that you use to open the app? MASShortcut
is just a trigger which runs in the app using it, and it should not have any influence on other apps in the system.
Sorry, that was my problem. I wrote the code that brings my windows to the front when the app enters the foreground as follows:
func applicationWillBecomeActive(notification: NSNotification) {
let windows = NSApp.windows as [NSWindow]
for window in windows {
if window.className != NSColorPanel.className() {
window.orderFront(self)
}
}
}
However, the similar code written in the shortcut handler didn't check on the NSColorPanel
, making my app to bring the color panel to the front.
Sorry, the app was last updated more than 1 year ago and I should have checked it out more closely. I deeply apologize for the issue. So let me close the issue...
It seems that when you register the shortcut and trigger the registered shortcut to open the app, the app opens but the NSPanel window does always show up on the front even if you already closed the panel, because the instance of the panel is still retained.
This does not occur when you manually select the app icon from the dock; it only occurs when launched via keyboard shortcut.
Is there any way to prevent the panel from being displayed when you trigger the shortcut? I use NSColorWell and NSColorPanel.