Patched to compile on pre-C99 compilers.
1.1 --- a/src/video/x11/SDL_x11mouse.c Wed Oct 29 22:55:40 2014 -0400
1.2 +++ b/src/video/x11/SDL_x11mouse.c Thu Oct 30 13:44:31 2014 -0400
1.3 @@ -378,6 +378,7 @@
1.4 int rootx, rooty, winx, winy;
1.5 unsigned int mask;
1.6 if (X11_XQueryPointer(display, RootWindow(display, data->screen), &root, &child, &rootx, &rooty, &winx, &winy, &mask)) {
1.7 + XWindowAttributes root_attrs;
1.8 Uint32 retval = 0;
1.9 retval |= (mask & Button1Mask) ? SDL_BUTTON_LMASK : 0;
1.10 retval |= (mask & Button2Mask) ? SDL_BUTTON_MMASK : 0;
1.11 @@ -386,7 +387,6 @@
1.12 * (observed on dual monitor setup with primary display being the rightmost one - mouse was offset to the right).
1.13 *
1.14 * Adding root position to root-relative coordinates seems to be a better way to get absolute position. */
1.15 - XWindowAttributes root_attrs;
1.16 X11_XGetWindowAttributes(display, root, &root_attrs);
1.17 *x = root_attrs.x + rootx;
1.18 *y = root_attrs.y + rooty;