[PATCH v2 1/2] winex11: Introduce a new handle_state_change helper.