Disable bringing app window to front. After closing another window

谁说胖子不能爱 提交于 2019-12-23 22:10:28

问题


I have OSX App that contains 2 NSWindowControllers. My problem is described by few steps:

  1. Launch the app with 2 windows
  2. Select the window of another app
  3. Put 1 of the windows in front of anther app window and the second will stay in the bottom.
  4. Close the window in the top.
  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!