src/video/x11/SDL_x11events.c
changeset 7838 909b0d7fe4dd
parent 7827 a03ec8de0426
child 7839 d2804f8153fe
equal deleted inserted replaced
7837:2f2f0b3b4702 7838:909b0d7fe4dd
   517 #ifdef DEBUG_XEVENTS
   517 #ifdef DEBUG_XEVENTS
   518             printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data,
   518             printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data,
   519                    xevent.xconfigure.x, xevent.xconfigure.y,
   519                    xevent.xconfigure.x, xevent.xconfigure.y,
   520                    xevent.xconfigure.width, xevent.xconfigure.height);
   520                    xevent.xconfigure.width, xevent.xconfigure.height);
   521 #endif
   521 #endif
       
   522             long border_left = 0;
       
   523             long border_right = 0;
       
   524             long border_top = 0;
       
   525             long border_bottom = 0;
       
   526             if (data->xwindow) {
       
   527                 Atom _net_frame_extents = XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
       
   528                 Atom type;
       
   529                 int format;
       
   530                 unsigned long nitems, bytes_after;
       
   531                 unsigned char *property;
       
   532                 XGetWindowProperty(display, data->xwindow,
       
   533                     _net_frame_extents, 0, 16, 0,
       
   534                     XA_CARDINAL, &type, &format,
       
   535                     &nitems, &bytes_after, &property);
       
   536 
       
   537                 border_left = ((long*)property)[0];
       
   538                 border_right = ((long*)property)[1];
       
   539                 border_top = ((long*)property)[2];
       
   540                 border_bottom = ((long*)property)[3];
       
   541             }
       
   542 
   522             if (xevent.xconfigure.x != data->last_xconfigure.x ||
   543             if (xevent.xconfigure.x != data->last_xconfigure.x ||
   523                 xevent.xconfigure.y != data->last_xconfigure.y) {
   544                 xevent.xconfigure.y != data->last_xconfigure.y) {
   524                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
   545                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
   525                                     xevent.xconfigure.x, xevent.xconfigure.y);
   546                                     xevent.xconfigure.x - border_left,
       
   547                                     xevent.xconfigure.y - border_top);
   526             }
   548             }
   527             if (xevent.xconfigure.width != data->last_xconfigure.width ||
   549             if (xevent.xconfigure.width != data->last_xconfigure.width ||
   528                 xevent.xconfigure.height != data->last_xconfigure.height) {
   550                 xevent.xconfigure.height != data->last_xconfigure.height) {
   529                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
   551                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED,
   530                                     xevent.xconfigure.width,
   552                                     xevent.xconfigure.width,