diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-07-01 18:44:39 +0200 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-10-04 17:18:41 +0200 |
commit | 425c59783c960e9f568b6c5e8920774ada9b87e5 (patch) | |
tree | 7a68a6b2cdc8f1f41d8d12e714f313e87d2c4f9a /src/plugins/platforms/xcb/qxcbscreen.cpp | |
parent | 932805807123833bb8f5ae9abda7e946f48d9f0c (diff) |
Xcb: fix rounding error in reporting screen refresh rate
Screen refresh rate might not be just integer but with decimal part
like, for example, 59.97 Hz. Fix calculation from raw xcb data and its
store type as it is qreal already for QScreen::refreshRate API.
Task-number: QTBUG-73911
Change-Id: Ia0494e953176c2854f0ed42c4498a29cfef16106
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index a5a2aeb9aa..0cf0942dab 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -790,7 +790,7 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode) xcb_randr_mode_info_t *modeInfo = modesIter.data; if (modeInfo->id == mode) { const uint32_t dotCount = modeInfo->htotal * modeInfo->vtotal; - m_refreshRate = (dotCount != 0) ? modeInfo->dot_clock / dotCount : 0; + m_refreshRate = (dotCount != 0) ? modeInfo->dot_clock / qreal(dotCount) : 0; m_mode = mode; break; } |