Commit ffecaf85 authored by Gunnar Sletta's avatar Gunnar Sletta Committed by The Qt Project
Browse files

QScreen::refreshRate would return 0 on Mac OS X


The function we use to get the actual vsync on cocoa is documented
to return 0 if the monitor is not a CRT monitor. A refreshrate
of 0 means we have vsync deltas of 1000/0 which cause problems
elsewhere. It is better to use the "default" value in this case
as it will be closer to correct than 0.

Change-Id: Id08007e40a9af5e42f13a07628fcad5fd3a7d0dc
Reviewed-by: default avatarMorten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: default avatarSamuel Rødal <samuel.rodal@digia.com>
parent 7c33ae6a
Branches
Tags
No related merge requests found
Showing with 3 additions and 1 deletion
...@@ -105,7 +105,9 @@ void QCocoaScreen::updateGeometry() ...@@ -105,7 +105,9 @@ void QCocoaScreen::updateGeometry()
m_physicalSize = QSizeF(size.width, size.height); m_physicalSize = QSizeF(size.width, size.height);
m_logicalDpi.first = 72; m_logicalDpi.first = 72;
m_logicalDpi.second = 72; m_logicalDpi.second = 72;
m_refreshRate = CGDisplayModeGetRefreshRate(CGDisplayCopyDisplayMode(dpy)); float refresh = CGDisplayModeGetRefreshRate(CGDisplayCopyDisplayMode(dpy));
if (refresh > 0)
m_refreshRate = refresh;
// Get m_name (brand/model of the monitor) // Get m_name (brand/model of the monitor)
NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(dpy), kIODisplayOnlyPreferredName); NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(dpy), kIODisplayOnlyPreferredName);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment