My desktop resolution is 1280x1024. I use SDL_SetVideoMode with fullscreen flag to enter fullscreen mode (800x600) and that works fine. When I try to exit fullscreen mode (calling SDL_SetVideoMode without fullscreen flag) my desktop resolution isn't restored... it's still 800x600.

How can I exit fullscreen mode properly?