summaryrefslogtreecommitdiff
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJames Turner <james.turner.qnx@kdab.com>2012-08-30 13:44:49 +0100
committerQt by Nokia <qt-info@nokia.com>2012-08-31 02:30:47 +0200
commit94aff97018f7036dba40c08a89e2a8012c235ee3 (patch)
tree5045bf70ef39c878ae2d18a7b2417db9ff2d1b00 /src/plugins/platforms
parent24d4234f6b86095d5ab84fa2071d0890be2154d5 (diff)
downloadqt4-tools-94aff97018f7036dba40c08a89e2a8012c235ee3.tar.gz
Backport fix screen event-registration failure.
Don't attempt to register for events from non-attached screens. Backport of commit 9597e0d2a23c4673aea7a74598a6a634527c443c from qt5/qtbase Change-Id: I95859abc476f43308ba9b2c684b8eaae731c59f6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/blackberry/qbbbpseventfilter.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp b/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp
index 81d7265d5d..2835cc04ab 100644
--- a/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp
+++ b/src/plugins/platforms/blackberry/qbbbpseventfilter.cpp
@@ -99,6 +99,19 @@ void QBBBpsEventFilter::registerForScreenEvents(QBBScreen *screen)
return;
}
+ int attached;
+ if (screen_get_display_property_iv(screen->nativeDisplay(), SCREEN_PROPERTY_ATTACHED, &attached) != BPS_SUCCESS) {
+ qWarning() << "QBB: unable to query display attachment";
+ return;
+ }
+
+ if (!attached) {
+#if defined(QBBBPSEVENTFILTER_DEBUG)
+ qDebug() << Q_FUNC_INFO << "skipping event registration for non-attached screen";
+#endif
+ return;
+ }
+
if (screen_request_events(screen->nativeContext()) != BPS_SUCCESS)
qWarning("QBB: failed to register for screen events on screen %p", screen->nativeContext());
}