fix changing state when swapping buffers. Closes T605

For some reason, this is not a real swap. Thanks to gregkh for the great
bug report.