[SDL 1.3] Window close event bug win32

Hi folks,

I’m trying to use SDL_SetEventFilter, to filter window events, but it
doesn’t seem to work with SDL_WINDOWEVENT_CLOSE (and I suspect won’t do with
others). My window gets closed anyway.

It looks like the issue in SDL_win32events.c line 493, the return type of
SDL_SendWindowEvent is ignored, so it has no idea whether I filtered out the
message or not, and CallWindowProc is still called with the close message
when I don’t want it to be. Could someone take a look at this?

Thanks,

nhOn 11 June 2010 22:51, Nether Hound <@Nether_Hound> wrote:

  1. Is there a replacement for EnableKeyRepeat?

  2. How do I get valid text input from an SDL_TEXTINPUT event? What exactly
    does SDL_TextInputEvent.text contain, and how do I convert it into readable
    characters.

  3. Key down events now have mod as a Uint16 instead of SDLMod. Has the
    usage / what the value represents changed as well?

  4. Is there a way to prevent the window being destroyed when the close
    button is pressed, and just get an SDL_QUIT event like before?

Thanks in advance,

nh

SDL_WINDOWEVENT is what you need to use.
You then need to process the event structure for SDL_WINDOWEVENT_CLOSE.------------------------
EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/

This is what I tried (it gets called and returns 0, but doesn’t actually
prevent my window being closed unless I change SDL_win32events.c to
recognise the return code and not call CallWindowProc):

struct Filter {
static int filter(void* userdata, SDL_Event* event) {
if (event->type == SDL_WINDOWEVENT) {
if (event->window.event == SDL_WINDOWEVENT_CLOSE) {
return 0;
}
}
return 1;
}
};
SDL_SetEventFilter(&Filter::filter, 0);

nhOn 12 June 2010 22:32, Nathaniel J Fries wrote:

SDL_WINDOWEVENT is what you need to use.
You then need to process the event structure for SDL_WINDOWEVENT_CLOSE.


EM3 Nathaniel Fries, U.S. Navy

http://natefries.net/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org