فهرست منبع

X11: Make more use of XRRGetScreenResourcesCurrent

Closes #877.
Camilla Löwy 8 سال پیش
والد
کامیت
e649708cb2
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 2 2
      src/x11_init.c
  2. 4 4
      src/x11_monitor.c

+ 2 - 2
src/x11_init.c

@@ -502,8 +502,8 @@ static GLFWbool initExtensions(void)
 
 
     if (_glfw.x11.randr.available)
     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]))
         if (!sr->ncrtc || !XRRGetCrtcGammaSize(_glfw.x11.display, sr->crtcs[0]))
         {
         {

+ 4 - 4
src/x11_monitor.c

@@ -114,7 +114,7 @@ GLFWbool _glfwSetVideoModeX11(_GLFWmonitor* monitor, const GLFWvidmode* desired)
         if (_glfwCompareVideoModes(&current, best) == 0)
         if (_glfwCompareVideoModes(&current, best) == 0)
             return GLFW_TRUE;
             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);
         ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);
         oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output);
         oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output);
 
 
@@ -174,7 +174,7 @@ void _glfwRestoreVideoModeX11(_GLFWmonitor* monitor)
         if (monitor->x11.oldMode == None)
         if (monitor->x11.oldMode == None)
             return;
             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);
         ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc);
 
 
         XRRSetCrtcConfig(_glfw.x11.display,
         XRRSetCrtcConfig(_glfw.x11.display,
@@ -209,8 +209,8 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
     {
     {
         int screenCount = 0;
         int screenCount = 0;
         XineramaScreenInfo* screens = NULL;
         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,
         RROutput primary = XRRGetOutputPrimary(_glfw.x11.display,
                                                _glfw.x11.root);
                                                _glfw.x11.root);