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>
This commit is contained in:
Roger Maclean 2014-12-15 17:17:43 -05:00 committed by Giuseppe D'Angelo
parent 1acb774b2b
commit 627afca13c

View File

@ -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;
}