Open detached window with correct content, fixes #311