From 43ad9670e6cc977ec1d072ef328d863e9e50a7cc Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 30 Oct 2014 13:44:31 -0400 Subject: [PATCH] Patched to compile on pre-C99 compilers. --- src/video/x11/SDL_x11mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index d3ec61902f14a..6a0207e90a8b3 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -378,6 +378,7 @@ X11_GetGlobalMouseState(int *x, int *y) 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 @@ X11_GetGlobalMouseState(int *x, int *y) * (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;