Weird window coordinates

I’m using SDL in Windows. To toggle between windowed and fullscreen I
destroy the window and create a new one.

I have this problem : when I’m in fullscreen, I alt-tab out. The window
gets minimized. I alt-tab back, I get fullscreen again. If now I try to
switch to windowed (SDL_SetVideoMode() without the fullscreen flag), I
get no errors or crashes, but the window isn’t visible - it’s on the
task bar but nothing else.

I traced the problem to a very wrong window position obtained with
GetWindowRect() : (-32003, -32055) - (-31197, -31423). The dimensions
are coherent for an 800x600 window but the rest obviously isn’t. The
problem looks easy to fix on my code, but maybe this is a SDL bug which
should be solved in SDL.

Has this been encountered before?

--Gabriel-- 

Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel on Graphics - http://gabrielongraphics.blogspot.com

I’m using SDL in Windows. To toggle between windowed and fullscreen I
destroy the window and create a new one.

I have this problem : when I’m in fullscreen, I alt-tab out. The window
gets minimized. I alt-tab back, I get fullscreen again. If now I try to
switch to windowed (SDL_SetVideoMode() without the fullscreen flag), I
get no errors or crashes, but the window isn’t visible - it’s on the
task bar but nothing else.

I traced the problem to a very wrong window position obtained with
GetWindowRect() : (-32003, -32055) - (-31197, -31423). The dimensions
are coherent for an 800x600 window but the rest obviously isn’t. The
problem looks easy to fix on my code, but maybe this is a SDL bug which
should be solved in SDL.

Has this been encountered before?

Can you try the latest CVS? I fixed some issues with changing
video resolutions and alt-tabbing on Windows.

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment