test/testwm.c
branchSDL-1.3
changeset 1731 875c3cf1a12c
parent 1724 6c63fc2bd986
     1.1 --- a/test/testwm.c	Sat Jul 08 18:06:02 2006 +0000
     1.2 +++ b/test/testwm.c	Sat Jul 08 20:07:08 2006 +0000
     1.3 @@ -175,11 +175,18 @@
     1.4      SDL_PushEvent(&event);
     1.5  }
     1.6  
     1.7 +static int SDLCALL(*old_filterfunc) (void *, SDL_Event *);
     1.8 +static void *old_filterdata;
     1.9 +
    1.10  int SDLCALL
    1.11  FilterEvents(void *userdata, SDL_Event * event)
    1.12  {
    1.13      static int reallyquit = 0;
    1.14  
    1.15 +    if (old_filterfunc) {
    1.16 +        old_filterfunc(old_filterdata, event);
    1.17 +    }
    1.18 +
    1.19      switch (event->type) {
    1.20  
    1.21      case SDL_ACTIVEEVENT:
    1.22 @@ -344,6 +351,7 @@
    1.23      }
    1.24  
    1.25      /* Set an event filter that discards everything but QUIT */
    1.26 +    SDL_GetEventFilter(&old_filterfunc, &old_filterdata);
    1.27      SDL_SetEventFilter(FilterEvents, NULL);
    1.28  
    1.29      /* Ignore key up events, they don't even get filtered */