Fix bug: B65-ZK-1568
- Window is always visible when switching to non-modal mode
  e.g. <window visible="false" mode="overlapped" /> would be visible
       <window mode="overlapped" visible="false" /> would be invisible