From e649708cb2655fdcdcca8e926ab56342a501b717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 18 Dec 2016 15:00:55 +0100 Subject: [PATCH] X11: Make more use of XRRGetScreenResourcesCurrent Closes #877. --- src/x11_init.c | 4 ++-- src/x11_monitor.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/x11_init.c b/src/x11_init.c index ca1bdf4b..91cced2b 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -502,8 +502,8 @@ static GLFWbool initExtensions(void) if (_glfw.x11.randr.available) { - XRRScreenResources* sr = XRRGetScreenResources(_glfw.x11.display, - _glfw.x11.root); + XRRScreenResources* sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, + _glfw.x11.root); if (!sr->ncrtc || !XRRGetCrtcGammaSize(_glfw.x11.display, sr->crtcs[0])) { diff --git a/src/x11_monitor.c b/src/x11_monitor.c index 4806f0f8..ce13d4a1 100644 --- a/src/x11_monitor.c +++ b/src/x11_monitor.c @@ -114,7 +114,7 @@ GLFWbool _glfwSetVideoModeX11(_GLFWmonitor* monitor, const GLFWvidmode* desired) if (_glfwCompareVideoModes(¤t, best) == 0) return GLFW_TRUE; - sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); + sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output); @@ -174,7 +174,7 @@ void _glfwRestoreVideoModeX11(_GLFWmonitor* monitor) if (monitor->x11.oldMode == None) return; - sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); + sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); XRRSetCrtcConfig(_glfw.x11.display, @@ -209,8 +209,8 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) { int screenCount = 0; XineramaScreenInfo* screens = NULL; - XRRScreenResources* sr = XRRGetScreenResources(_glfw.x11.display, - _glfw.x11.root); + XRRScreenResources* sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, + _glfw.x11.root); RROutput primary = XRRGetOutputPrimary(_glfw.x11.display, _glfw.x11.root);