src/video/x11/SDL_x11events.c
changeset 7885 a8bd63b33636
parent 7857 6388f5229bb7
child 7902 0c2e2b91eeea
equal deleted inserted replaced
7884:15027aa2cf21 7885:a8bd63b33636
   523             long border_right = 0;
   523             long border_right = 0;
   524             long border_top = 0;
   524             long border_top = 0;
   525             long border_bottom = 0;
   525             long border_bottom = 0;
   526             if (data->xwindow) {
   526             if (data->xwindow) {
   527                 Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
   527                 Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
   528                 Atom type;
   528                 Atom type = None;
   529                 int format;
   529                 int format;
   530                 unsigned long nitems, bytes_after;
   530                 unsigned long nitems = 0, bytes_after;
   531                 unsigned char *property;
   531                 unsigned char *property;
   532                 X11_XGetWindowProperty(display, data->xwindow,
   532                 X11_XGetWindowProperty(display, data->xwindow,
   533                     _net_frame_extents, 0, 16, 0,
   533                     _net_frame_extents, 0, 16, 0,
   534                     XA_CARDINAL, &type, &format,
   534                     XA_CARDINAL, &type, &format,
   535                     &nitems, &bytes_after, &property);
   535                     &nitems, &bytes_after, &property);
   536 
   536 
   537                 border_left = ((long*)property)[0];
   537                 if (type != None && nitems == 4)
   538                 border_right = ((long*)property)[1];
   538                 {
   539                 border_top = ((long*)property)[2];
   539                     border_left = ((long*)property)[0];
   540                 border_bottom = ((long*)property)[3];
   540                     border_right = ((long*)property)[1];
       
   541                     border_top = ((long*)property)[2];
       
   542                     border_bottom = ((long*)property)[3];
       
   543                 }
   541             }
   544             }
   542 
   545 
   543             if (xevent.xconfigure.x != data->last_xconfigure.x ||
   546             if (xevent.xconfigure.x != data->last_xconfigure.x ||
   544                 xevent.xconfigure.y != data->last_xconfigure.y) {
   547                 xevent.xconfigure.y != data->last_xconfigure.y) {
   545                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
   548                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,