From becb5c2dc1b52f8e2d7ff14f208e3afbe650a019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 1 Aug 2013 08:38:05 +0200 Subject: [PATCH] Port detection of screen rate to XCB New wrapper class added to xcbutils in a new RandR namespace. --- options.cpp | 6 ++---- xcbutils.h | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/options.cpp b/options.cpp index 2bd7a06d58..76ac67a8b9 100644 --- a/options.cpp +++ b/options.cpp @@ -40,7 +40,6 @@ along with this program. If not, see . #include "xcbutils.h" #include -#include #ifndef KWIN_HAVE_OPENGLES #ifndef KWIN_NO_XF86VM #include @@ -100,9 +99,8 @@ int currentRefreshRate() } #endif else if (Xcb::Extensions::self()->isRandrAvailable()) { - XRRScreenConfiguration *config = XRRGetScreenInfo(display(), rootWindow()); - rate = XRRConfigCurrentRate(config); - XRRFreeScreenConfigInfo(config); + Xcb::RandR::ScreenInfo screenInfo(rootWindow()); + rate = screenInfo->rate; } // 0Hz or less is invalid, so we fallback to a default rate diff --git a/xcbutils.h b/xcbutils.h index 6c7c32f311..585a21b601 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -31,6 +31,7 @@ along with this program. If not, see . #include #include +#include #define class class_name //HACK: work around a non-C++ safe problem in xcb_iccm.h //where they put a variable called "class" in function signatures. //Needed at least for xcb v0.3.8 @@ -234,6 +235,11 @@ public: } }; +namespace RandR +{ +typedef Wrapper ScreenInfo; +} + class ExtensionData { public: