update window states