diff -r 8feb5da6f2fb src/video/x11/SDL_x11window.c --- a/src/video/x11/SDL_x11window.c Tue Oct 30 20:11:02 2018 +0300 +++ b/src/video/x11/SDL_x11window.c Wed May 29 21:32:11 2019 -0400 @@ -785,9 +785,24 @@ { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; + unsigned int childCount; + Window childReturn, root, parent; + Window* children; + XWindowAttributes attrs; + /*Attempt to move the window*/ X11_XMoveWindow(display, data->xwindow, window->x - data->border_left, window->y - data->border_top); X11_XFlush(display); + + /*If the window is not moved, then the coordinates on the window structure are out of sync, so we + update them here. */ + X11_XQueryTree(display, data->xwindow, &root, &parent, &children, &childCount); + X11_XGetWindowAttributes(display, data->xwindow, &attrs); + X11_XTranslateCoordinates(display, + parent, DefaultRootWindow(display), + attrs.x, attrs.y, + &window->x, &window->y, + &childReturn); } void