New helper function remove_wwindowstate()