Fix fault with window state being incorrectly reflected in the menus