isVisible == YES means that your window is still present on the screen or reduced to Dock.
Well, I've never used this option before ... But if you really want to hide the window when your application loses focus, execute the -applicationDidResignActive:method NSApplicationDelegateand call -orderOut:for your window.
This will give you a stable result.
source
share