From c7b6a666a8b91144211fa4f160908c3f0be8e17e Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 16 Aug 2012 11:21:06 +0100 Subject: 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 Reviewed-by: Frank Osterfeld Reviewed-by: Giuseppe D'Angelo --- src/plugins/platforms/qnx/qqnxscreen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/qnx/qqnxscreen.cpp') 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; -- cgit v1.2.3