Added support for getting the current screen refresh rate using the XrandR extension.

This commit is contained in:
Robert Osfield
2011-02-04 10:27:05 +00:00
parent bd6009f9f2
commit d218a8c9a7

View File

@@ -1910,7 +1910,22 @@ public:
resolution.width = DisplayWidth(display, si.screenNum);
resolution.height = DisplayHeight(display, si.screenNum);
resolution.colorDepth = DefaultDepth(display, si.screenNum);
resolution.refreshRate = 0; // Missing call. Need a X11 expert.
#ifdef OSGVIEWER_USE_XRANDR
if (supportsRandr(display))
{
XRRScreenConfiguration* screenConfig = XRRGetScreenInfo ( display, RootWindow(display, si.screenNum) );
resolution.refreshRate = XRRConfigCurrentRate ( screenConfig );
XRRFreeScreenConfigInfo( screenConfig );
}
#endif
XCloseDisplay(display);
}