src/video/x11/SDL_x11events.c
changeset 7838 909b0d7fe4dd
parent 7827 a03ec8de0426
child 7839 d2804f8153fe
     1.1 --- a/src/video/x11/SDL_x11events.c	Sat Oct 19 01:29:23 2013 -0700
     1.2 +++ b/src/video/x11/SDL_x11events.c	Sun Oct 20 17:23:43 2013 +0200
     1.3 @@ -519,10 +519,32 @@
     1.4                     xevent.xconfigure.x, xevent.xconfigure.y,
     1.5                     xevent.xconfigure.width, xevent.xconfigure.height);
     1.6  #endif
     1.7 +            long border_left = 0;
     1.8 +            long border_right = 0;
     1.9 +            long border_top = 0;
    1.10 +            long border_bottom = 0;
    1.11 +            if (data->xwindow) {
    1.12 +                Atom _net_frame_extents = XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
    1.13 +                Atom type;
    1.14 +                int format;
    1.15 +                unsigned long nitems, bytes_after;
    1.16 +                unsigned char *property;
    1.17 +                XGetWindowProperty(display, data->xwindow,
    1.18 +                    _net_frame_extents, 0, 16, 0,
    1.19 +                    XA_CARDINAL, &type, &format,
    1.20 +                    &nitems, &bytes_after, &property);
    1.21 +
    1.22 +                border_left = ((long*)property)[0];
    1.23 +                border_right = ((long*)property)[1];
    1.24 +                border_top = ((long*)property)[2];
    1.25 +                border_bottom = ((long*)property)[3];
    1.26 +            }
    1.27 +
    1.28              if (xevent.xconfigure.x != data->last_xconfigure.x ||
    1.29                  xevent.xconfigure.y != data->last_xconfigure.y) {
    1.30                  SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED,
    1.31 -                                    xevent.xconfigure.x, xevent.xconfigure.y);
    1.32 +                                    xevent.xconfigure.x - border_left,
    1.33 +                                    xevent.xconfigure.y - border_top);
    1.34              }
    1.35              if (xevent.xconfigure.width != data->last_xconfigure.width ||
    1.36                  xevent.xconfigure.height != data->last_xconfigure.height) {