Changeset View
Changeset View
Standalone View
Standalone View
options.cpp
Show All 25 Lines | |||||
26 | #include "platform.h" | 26 | #include "platform.h" | ||
27 | 27 | | |||
28 | #ifndef KCMRULES | 28 | #ifndef KCMRULES | ||
29 | 29 | | |||
30 | #include <QProcess> | 30 | #include <QProcess> | ||
31 | 31 | | |||
32 | #include "screens.h" | 32 | #include "screens.h" | ||
33 | #include "settings.h" | 33 | #include "settings.h" | ||
34 | #include "xcbutils.h" | | |||
35 | #include <kwinglplatform.h> | 34 | #include <kwinglplatform.h> | ||
36 | #include <QOpenGLContext> | 35 | #include <QOpenGLContext> | ||
37 | 36 | | |||
38 | #endif //KCMRULES | 37 | #endif //KCMRULES | ||
39 | 38 | | |||
40 | namespace KWin | 39 | namespace KWin | ||
41 | { | 40 | { | ||
42 | 41 | | |||
Show All 19 Lines | 60 | if (Screens::self()->name(i) == syncDisplayDevice) { | |||
62 | syncScreenName = Screens::self()->name(i); | 61 | syncScreenName = Screens::self()->name(i); | ||
63 | syncScreen = i; | 62 | syncScreen = i; | ||
64 | break; | 63 | break; | ||
65 | } | 64 | } | ||
66 | } | 65 | } | ||
67 | } | 66 | } | ||
68 | } | 67 | } | ||
69 | rate = qRound(Screens::self()->refreshRate(syncScreen)); // TODO forward float precision? | 68 | rate = qRound(Screens::self()->refreshRate(syncScreen)); // TODO forward float precision? | ||
70 | } else if (Xcb::Extensions::self()->isRandrAvailable()) { | | |||
71 | // last restort - query XRandR screenInfo rate - probably wrong on nvidia systems | | |||
72 | Xcb::RandR::ScreenInfo screenInfo(rootWindow()); | | |||
73 | rate = screenInfo->rate; | | |||
74 | } | 69 | } | ||
75 | 70 | | |||
76 | // 0Hz or less is invalid, so we fallback to a default rate | 71 | // 0Hz or less is invalid, so we fallback to a default rate | ||
77 | if (rate <= 0) | 72 | if (rate <= 0) | ||
78 | rate = 60; // and not shitty 50Hz for sure! *grrr* | 73 | rate = 60; // and not shitty 50Hz for sure! *grrr* | ||
79 | 74 | | |||
80 | // QTimer gives us 1msec (1000Hz) at best, so we ignore anything higher; | 75 | // QTimer gives us 1msec (1000Hz) at best, so we ignore anything higher; | ||
81 | // however, additional throttling prevents very high rates from taking place anyway | 76 | // however, additional throttling prevents very high rates from taking place anyway | ||
▲ Show 20 Lines • Show All 1070 Lines • Show Last 20 Lines |