Search code examples
cocoahidenswindowvisible

NSWindow - Deactivate on Hide - isVisible


I have an NSWindow with a "Hide on deactivate" set to TRUE.

When my application looses focus, the window disappears, however, testing that by "isVisible" gives TRUE. What is going on?


Solution

  • isVisible == YES means that your window is still present on the screen or miniaturized to Dock.

    Well, I never used this option before... But, if you really want to hide the window when your app loses focus, implement -applicationDidResignActive: method of NSApplicationDelegate and call -orderOut: for your window.

    That will give you a stable result.