Properly reset windows geometry and state