src/video/x11/SDL_x11events.c
changeset 6542 5c1b8ed19212
parent 6504 100c49578dba
child 6637 31e3f5b04120
equal deleted inserted replaced
6541:be103236441d 6542:5c1b8ed19212
   363         break;
   363         break;
   364 
   364 
   365         /* Have we been resized or moved? */
   365         /* Have we been resized or moved? */
   366     case ConfigureNotify:{
   366     case ConfigureNotify:{
   367 #ifdef DEBUG_XEVENTS
   367 #ifdef DEBUG_XEVENTS
   368             printf("window %p: ConfigureNotify! (resize: %dx%d)\n", data,
   368             printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data,
       
   369                    xevent.xconfigure.x, xevent.xconfigure.y,
   369                    xevent.xconfigure.width, xevent.xconfigure.height);
   370                    xevent.xconfigure.width, xevent.xconfigure.height);
   370 #endif
   371 #endif
   371             SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
   372             if (xevent.xconfigure.x != data->last_xconfigure.x ||
   372                                 xevent.xconfigure.x, xevent.xconfigure.y);
   373                 xevent.xconfigure.y != data->last_xconfigure.y) {
   373             SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
   374                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
   374                                 xevent.xconfigure.width,
   375                                     xevent.xconfigure.x, xevent.xconfigure.y);
   375                                 xevent.xconfigure.height);
   376             }
       
   377             if (xevent.xconfigure.width != data->last_xconfigure.width ||
       
   378                 xevent.xconfigure.height != data->last_xconfigure.height) {
       
   379                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
       
   380                                     xevent.xconfigure.width,
       
   381                                     xevent.xconfigure.height);
       
   382             }
       
   383             data->last_xconfigure = xevent.xconfigure;
   376         }
   384         }
   377         break;
   385         break;
   378 
   386 
   379         /* Have we been requested to quit (or another client message?) */
   387         /* Have we been requested to quit (or another client message?) */
   380     case ClientMessage:{
   388     case ClientMessage:{