test/testwm2.c
changeset 5246 58265e606e4e
parent 3338 9de326b3099c
child 5535 96594ac5fd1a
     1.1 --- a/test/testwm2.c	Thu Feb 10 14:36:09 2011 -0800
     1.2 +++ b/test/testwm2.c	Thu Feb 10 14:44:25 2011 -0800
     1.3 @@ -49,6 +49,19 @@
     1.4          /* Check for events */
     1.5          while (SDL_PollEvent(&event)) {
     1.6              CommonEvent(state, &event, &done);
     1.7 +
     1.8 +            if (event.type == SDL_WINDOWEVENT) {
     1.9 +                if (event.window.event == SDL_WINDOWEVENT_MOVED) {
    1.10 +                    SDL_Window *window = SDL_GetWindowFromID(event.window.windowID);
    1.11 +                    if (window) {
    1.12 +                        printf("Window %d moved to %d,%d (display %d)\n",
    1.13 +                            event.window.windowID,
    1.14 +                            event.window.data1,
    1.15 +                            event.window.data2,
    1.16 +                            SDL_GetWindowDisplay(window));
    1.17 +                    }
    1.18 +                }
    1.19 +            }
    1.20          }
    1.21      }
    1.22      quit(0);