-Fixed issue with visibility flag when a detached window is attached.