c8f8dd894e
The surface type now no longer changes and we track pending state changes in next_state. Instead of testing type != next_type to detect changes in state, we just look at state_changed.