win: Implement window state events