From 6c37c84d91d37925b14b9dadb988b02255533cc3 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 30 Jul 2012 20:15:34 +0200 Subject: [PATCH] Reduced the number of conditional blocks. --- src/x11_window.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index 84b6f7d6..e5c548de 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1139,20 +1139,14 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window) void _glfwPlatformRefreshWindowParams(void) { -#if defined(_GLFW_HAS_XRANDR) - XRRScreenConfiguration* sc; -#endif /*_GLFW_HAS_XRANDR*/ -#if defined(_GLFW_HAS_XF86VIDMODE) - XF86VidModeModeLine modeline; - int dotclock; - float pixels_per_second, pixels_per_frame; -#endif /*_GLFW_HAS_XF86VIDMODE*/ _GLFWwindow* window = _glfwLibrary.currentWindow; // Retrieve refresh rate if possible if (_glfwLibrary.X11.RandR.available) { #if defined(_GLFW_HAS_XRANDR) + XRRScreenConfiguration* sc; + sc = XRRGetScreenInfo(_glfwLibrary.X11.display, _glfwLibrary.X11.root); window->refreshRate = XRRConfigCurrentRate(sc); XRRFreeScreenConfigInfo(sc); @@ -1161,6 +1155,10 @@ void _glfwPlatformRefreshWindowParams(void) else if (_glfwLibrary.X11.VidMode.available) { #if defined(_GLFW_HAS_XF86VIDMODE) + XF86VidModeModeLine modeline; + int dotclock; + float pixels_per_second, pixels_per_frame; + // Use the XF86VidMode extension to get current video mode XF86VidModeGetModeLine(_glfwLibrary.X11.display, _glfwLibrary.X11.screen,