diff options
author | Roger Maclean <rmaclean@qnx.com> | 2014-12-15 17:17:43 -0500 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-12-18 11:35:30 +0100 |
commit | 627afca13cf1b23489a1c61d1eb66cbdafff91bd (patch) | |
tree | 0778257b561ee4279e00a35939b4983171b91dff /src/plugins/platforms/qnx | |
parent | 1acb774b2b11638ee40c8a96af659071926732f9 (diff) |
QNX: Handle the case where screen returns a refresh rate of 0.
Screen sometimes returns a refresh rate of 0. This has been observed
on VMWare though it is unknown if this is always the case and whether
it happens on other platforms as well. Returning a refresh rate of
0 causes animations to fail so we're better off returning a value that
might be wrong than returning 0.
Change-Id: I4846017bcb0d6bd52faad727df4ef6dac1a6250f
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index f3f93e7f64..d42babb8ab 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -329,7 +329,8 @@ qreal QQnxScreen::refreshRate() const { screen_display_mode_t displayMode; int result = screen_get_display_property_pv(m_display, SCREEN_PROPERTY_MODE, reinterpret_cast<void **>(&displayMode)); - if (result != 0) { + // Screen shouldn't really return 0 but it does so default to 60 or things break. + if (result != 0 || displayMode.refresh == 0) { qWarning("QQnxScreen: Failed to query screen mode. Using default value of 60Hz"); return 60.0; } |