summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJames Turner <james.turner.qnx@kdab.com>2012-08-30 11:02:25 +0100
committerQt by Nokia <qt-info@nokia.com>2012-08-30 13:51:22 +0200
commit9597e0d2a23c4673aea7a74598a6a634527c443c (patch)
tree47a4cfef606434955cd2fe7d781160b117f18b36 /src/plugins
parenta3963d8bbcf7b4916c0e7c983cf32f95bf727e8c (diff)
Avoid a warning from the QNX QPA plugin.
The HDMI display on the Playbook is listed, but (normally) unattached, and hence generates an error if we attempt to register for events. This patch avoids the warning; a future change will actually watch for screens being attached / detached and update the QPlatformScreens and event registration correctly. Change-Id: I5a9cc773648d50f657fe1b3611fd42495ca7e836 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/qnx/qqnxbpseventfilter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
index 4ce38b9fdc..2e4583119f 100644
--- a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
+++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
@@ -100,6 +100,17 @@ void QQnxBpsEventFilter::registerForScreenEvents(QQnxScreen *screen)
return;
}
+ int attached;
+ if (screen_get_display_property_iv(screen->nativeDisplay(), SCREEN_PROPERTY_ATTACHED, &attached) != BPS_SUCCESS) {
+ qWarning() << "QQNX: unable to query display attachment";
+ return;
+ }
+
+ if (!attached) {
+ qBpsEventFilterDebug() << "skipping event registration for non-attached screen";
+ return;
+ }
+
if (screen_request_events(screen->nativeContext()) != BPS_SUCCESS)
qWarning("QQNX: failed to register for screen events on screen %p", screen->nativeContext());
}