Patched to compile on pre-C99 compilers.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 30 Oct 2014 13:44:31 -0400
changeset 9207 10f4459a8b9a
parent 9206 f20d288435bd
child 9208 a396a375e6c5
Patched to compile on pre-C99 compilers.
src/video/x11/SDL_x11mouse.c
--- a/src/video/x11/SDL_x11mouse.c	Wed Oct 29 22:55:40 2014 -0400
+++ b/src/video/x11/SDL_x11mouse.c	Thu Oct 30 13:44:31 2014 -0400
@@ -378,6 +378,7 @@
             int rootx, rooty, winx, winy;
             unsigned int mask;
             if (X11_XQueryPointer(display, RootWindow(display, data->screen), &root, &child, &rootx, &rooty, &winx, &winy, &mask)) {
+                XWindowAttributes root_attrs;
                 Uint32 retval = 0;
                 retval |= (mask & Button1Mask) ? SDL_BUTTON_LMASK : 0;
                 retval |= (mask & Button2Mask) ? SDL_BUTTON_MMASK : 0;
@@ -386,7 +387,6 @@
                  * (observed on dual monitor setup with primary display being the rightmost one - mouse was offset to the right).
                  *
                  * Adding root position to root-relative coordinates seems to be a better way to get absolute position. */
-                XWindowAttributes root_attrs;
                 X11_XGetWindowAttributes(display, root, &root_attrs);
                 *x = root_attrs.x + rootx;
                 *y = root_attrs.y + rooty;