Rendering takes the current buffer into account, so change its value before using it, not afterwards. The order happened to not matter on at least Windows, because we just queue a message.
Some work remains to be done to get it to be even as good as the Win32 frontend, but it's generally usable.