src/events/SDL_events.c
changeset 7201 c6b3d3c32507
parent 7191 75360622e65f
child 7304 9598cbf46957
     1.1 --- a/src/events/SDL_events.c	Mon May 20 22:05:49 2013 -0700
     1.2 +++ b/src/events/SDL_events.c	Mon May 20 23:04:25 2013 -0700
     1.3 @@ -388,12 +388,11 @@
     1.4  void
     1.5  SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
     1.6  {
     1.7 -    SDL_Event bitbucket;
     1.8 -
     1.9      /* Set filter and discard pending events */
    1.10 -    SDL_EventOK = filter;
    1.11 +    SDL_EventOK = NULL;
    1.12 +    SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
    1.13      SDL_EventOKParam = userdata;
    1.14 -    while (SDL_PollEvent(&bitbucket) > 0);
    1.15 +    SDL_EventOK = filter;
    1.16  }
    1.17  
    1.18  SDL_bool