My application has two windows(main and video) and both can enter the Full-Screen mode independently. And the main window has a button to toggle the video window's visibility. When the video window is visible, the button simply sends close message like this:
[theVideoWindow close];
It works perfectly when the video window is not in the Full-Screen mode.
But when the video window is running in the Full-Screen mode, the window looks like being ordered out (closed), but it is still alive (like an invisible window) and accepts mouse event. The user cannot interact with other applications because the invisible window eats up all the mouse events and cannot close it because the title bar and menu are gone.
Are there any best practices to close a Full-Screen mode window programmatically other than exiting from the Full-Screen mode first and then closing it in NSWindowDidExitFullScreenNotification notification handler?
Thanks in advance.
It seems to be my mistake. The other developer, explicitly send orderFront: in the NSWindowDidExitFullScreenNotification notification handler to make the window visible just after exiting from the Full-Screen mode and it made the window was still alive.