diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-08-16 11:21:06 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-17 12:23:43 +0200 |
commit | c7b6a666a8b91144211fa4f160908c3f0be8e17e (patch) | |
tree | b90c45a5823c43d9fb9296b10656156f31537cc9 /src/plugins/platforms/qnx | |
parent | 525ec093b4c74b9e04ee35135975cf61e32c73fd (diff) |
QNX: Allow app to run when spurious 2nd screen is reported
On the PlayBook, libscreen always seems to report the presence of a 2nd
display even when none is connected. This of course leads to the failure
to query this display for its physical size.
This patch relaxes the demand for a physical size to being for the
primary screen only.
Change-Id: If30b1fd704e7a194a426a0a9f0b85557478105f7
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 91ee2d3174..95b3ef0e1e 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE -static QSize determineScreenSize(screen_display_t display) { +static QSize determineScreenSize(screen_display_t display, bool primaryScreen) { int val[2]; errno = 0; @@ -96,9 +96,9 @@ static QSize determineScreenSize(screen_display_t display) { const QSize defSize(QQNX_PHYSICAL_SCREEN_WIDTH, QQNX_PHYSICAL_SCREEN_HEIGHT); qWarning("QQnxScreen: QQNX_PHYSICAL_SCREEN_SIZE variable not set. Falling back to defines QQNX_PHYSICAL_SCREEN_WIDTH/QQNX_PHYSICAL_SCREEN_HEIGHT (%dx%d)", defSize.width(), defSize.height()); return defSize; - #else - qFatal("QQnxScreen: QQNX_PHYSICAL_SCREEN_SIZE variable not set. Could not determine physical screen size."); + if (primaryScreen) + qFatal("QQnxScreen: QQNX_PHYSICAL_SCREEN_SIZE variable not set. Could not determine physical screen size."); return QSize(150, 90); #endif } @@ -136,7 +136,7 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, // libscreen always reports the physical size dimensions as width and height in the // native orientation. Contrary to this, QPlatformScreen::physicalSize() expects the // returned dimensions to follow the current orientation. - const QSize screenSize = determineScreenSize(m_display); + const QSize screenSize = determineScreenSize(m_display, primaryScreen); m_nativeOrientation = screenSize.width() >= screenSize.height() ? Qt::LandscapeOrientation : Qt::PortraitOrientation; |