added ability to set the window state of a session