src/video/x11/SDL_x11events.c
changeset 6542 5c1b8ed19212
parent 6504 100c49578dba
child 6637 31e3f5b04120
     1.1 --- a/src/video/x11/SDL_x11events.c	Wed Oct 03 12:33:42 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11events.c	Wed Oct 03 13:37:44 2012 -0700
     1.3 @@ -365,14 +365,22 @@
     1.4          /* Have we been resized or moved? */
     1.5      case ConfigureNotify:{
     1.6  #ifdef DEBUG_XEVENTS
     1.7 -            printf("window %p: ConfigureNotify! (resize: %dx%d)\n", data,
     1.8 +            printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data,
     1.9 +                   xevent.xconfigure.x, xevent.xconfigure.y,
    1.10                     xevent.xconfigure.width, xevent.xconfigure.height);
    1.11  #endif
    1.12 -            SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
    1.13 -                                xevent.xconfigure.x, xevent.xconfigure.y);
    1.14 -            SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
    1.15 -                                xevent.xconfigure.width,
    1.16 -                                xevent.xconfigure.height);
    1.17 +            if (xevent.xconfigure.x != data->last_xconfigure.x ||
    1.18 +                xevent.xconfigure.y != data->last_xconfigure.y) {
    1.19 +                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
    1.20 +                                    xevent.xconfigure.x, xevent.xconfigure.y);
    1.21 +            }
    1.22 +            if (xevent.xconfigure.width != data->last_xconfigure.width ||
    1.23 +                xevent.xconfigure.height != data->last_xconfigure.height) {
    1.24 +                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
    1.25 +                                    xevent.xconfigure.width,
    1.26 +                                    xevent.xconfigure.height);
    1.27 +            }
    1.28 +            data->last_xconfigure = xevent.xconfigure;
    1.29          }
    1.30          break;
    1.31