Make ToggleMenus close open windows (Fixes #2045)