Bug in WM_ACTIVATE handler - Fix included

Hi,

found a bug myself this time!

When using “testsprite -fullscreen” (with an implicit -bpp 8)
and my desktop set to 16-bit, or "testsprite -bpp 16 -fullscreen"
with my desktop set to 8-bit, I get an SDL Parachute.

ONLY happens on my two Windows 95 boxes (different videocards,
processors and DX versions), Windows 98 (same hardware as one of the
95 boxes) and Win2K seem to work fine.

Happens every time, both machines are quite different, only happens
with fullscreen.

I have traced it (painfully in fullscreen) to the WM_ACTIVATE handler,
here is my fix :

File: wincommon/sdl_sysevents.c
Line: ~205


case WM_ACTIVATE: {
SDL_VideoDevice *this = current_video;
BOOL minimized;
Uint8 appstate;

if ( !current_video->screen ) <------- add these
return 0; <------- two lines

minimized = HIWORD(wParam);

Had a quick look at my own DX code (developed on Win95) and sure enough
there is a check in my WM_ACTIVATE handler.

Hoping someone else can confirm the problem, and perhaps test the solution,

cheers,
John Popplewell.
PS here’s hoping 1.2.4 will be a good one!

I have traced it (painfully in fullscreen) to the WM_ACTIVATE handler,
here is my fix :

[snipped]

I’ve applied this fix to CVS. Does this do everything that it needs to?
For example, is the keyboard state properly initialized when this code
is triggered?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

For example, is the keyboard state properly initialized when this code
is triggered?

Ooops! Sorry, that’s a good point. I will check,

cheers,
John.

Hi,

You were right about the keyboard initialization.

The fix is bollocks!
Please remove it from CVS!

I will create a patch that actually works.
Sorry about that, my enthusiasm got the better of me!

cheers,
John Popplewell.> ----- Original Message -----

From: @John_Popplewell (John Popplewell)
To:
Sent: Wednesday, April 10, 2002 12:52 AM
Subject: Re: [SDL] Bug in WM_ACTIVATE handler - Fix included.

For example, is the keyboard state properly initialized when this code
is triggered?

Ooops! Sorry, that’s a good point. I will check,

cheers,
John.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl