Active Events on Windows XP

Hello,
I have been having issues with SDL Event code using Visual C++.net on
XP. (SDL-1.2.5a)

I was told on a message board that this code appears as if it should 

work fine, but when the application is minimized without the user
hitting the - button in the top left corner of the window like if I
click on the program’s entry in the taskbar or another app takes focus
from it, then it never gets the active message when it is returned
focus. Is there something I am missing in my event checking code or
should this concidered a bug?

Here is the code in question:

-code-----------------

case SDL_ACTIVEEVENT:
if(event.active.state == SDL_APPACTIVE ||
event.active.state == SDL_APPINPUTFOCUS)
{
if(event.active.gain == 1)
{
Active = true;
if(UnpauseOnActive)
UnpauseTimer();
}
else
{
Active = UnpauseOnActive = false;
if(!Paused)
{
UnpauseOnActive = true;
PauseTimer();
}
else
UnpauseOnActive = false;
}
}

-end code-------------

After recieving no reply I figure I had better simplify the situation…

Basically if another window gains focus, any application with the code
below will never recieve it’s active event. Could someone test this on
another system? Is my event handling completely wrong?> Hello,

I have been having issues with SDL Event code using Visual C++.net on
XP. (SDL-1.2.5a)

I was told on a message board that this code appears as if it should
work fine, but when the application is minimized without the user
hitting the - button in the top left corner of the window like if I
click on the program’s entry in the taskbar or another app takes focus
from it, then it never gets the active message when it is returned
focus. Is there something I am missing in my event checking code or
should this concidered a bug?

Here is the code in question:

-code-----------------

case SDL_ACTIVEEVENT:
if(event.active.state == SDL_APPACTIVE ||
event.active.state == SDL_APPINPUTFOCUS)
{
if(event.active.gain == 1)
{
Active = true;
if(UnpauseOnActive)
UnpauseTimer();
}
else
{
Active = UnpauseOnActive = false;
if(!Paused)
{
UnpauseOnActive = true;
PauseTimer();
}
else
UnpauseOnActive = false;
}
}

-end code-------------

After recieving no reply I figure I had better simplify the situation…

Basically if another window gains focus, any application with the code
below will never recieve it’s active event. Could someone test this on
another system? Is my event handling completely wrong?

No, it looks fine. Have you tried the ‘testwm’ test program in the SDL
source archive? I ran it on Windows 98, clicked on the icon in the taskbar,
clicked on it again, and hit escape with the following output:

Transparent pixel: (255,255,255)
Title was set to: Testing 1… 2… 3…
Running in windowed mode
App lost input focus
App lost active input focus
App has been iconified
App gained active input focus
App has been restored
Posting internal quit request
Handling internal quit request
Bye bye…
App lost input focus

It looks like it works here. What results do you get?

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

I have since fixed my problem, and my testwm run went fine. I had
to handle the expose event for some reason, and by the way it appears as
if there are numerous problems on
http://sdldoc.csn.ul.ie/sdlexposeevent.php (as tomic at email.hinet.hr
already pointed out).

    -James

Sam Lantinga wrote:>>After recieving no reply I figure I had better simplify the situation…

Basically if another window gains focus, any application with the code
below will never recieve it’s active event. Could someone test this on
another system? Is my event handling completely wrong?

No, it looks fine. Have you tried the ‘testwm’ test program in the SDL
source archive? I ran it on Windows 98, clicked on the icon in the taskbar,
clicked on it again, and hit escape with the following output:

Transparent pixel: (255,255,255)
Title was set to: Testing 1… 2… 3…
Running in windowed mode
App lost input focus
App lost active input focus
App has been iconified
App gained active input focus
App has been restored
Posting internal quit request
Handling internal quit request
Bye bye…
App lost input focus

It looks like it works here. What results do you get?

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