问题
I have OSX App that contains 2 NSWindowControllers. My problem is described by few steps:
- Launch the app with 2 windows
- Select the window of another app
- Put 1 of the windows in front of anther app window and the second will stay in the bottom.
- Close the window in the top.
- The second window will be brought to the top immediately.(I need to fix it and keep my second window in the bottom.)
Also I hope to cancel this behavior. Not just make an opposite action like NSApp.hide()/NSApp.deactivate etc.
I know that it is a default behavor(e.g. Finder do the same), but I have to disable it. Also the case I've just described is a bit strange, but in my app it is really needed =(
I've tried to override becomeKey, becomeMain for main window, but it hasn't help.
override func becomeKey() {
}
override func becomeMain() {
}
PS I'll be thankful for any ideas.
来源:https://stackoverflow.com/questions/45417071/disable-bringing-app-window-to-front-after-closing-another-window