summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer.qnx@kdab.com>2012-05-21 16:08:15 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-23 03:15:18 +0200
commit03392e1edffee2ea7fdbcbee546dd5b11a448bc2 (patch)
tree4d78a92eb981ad54550750a074aff44c10cae3fe /src
parent3a14f0301c4cce71a5573c6e5742dc6d00967b6c (diff)
QNX: Register for navigator events before any window creation
This prevents a possible race condition in which the nvaigator service notices that we have created a window and starts sending us messages possibly before we have registered with bps for navigator messages. This resulted in applications sometimes missing navigator messages at startup. Change-Id: I362fd782d7798990bc196f23e07b58293b13275d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 2f4e8cd19a..59d7f13f8a 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -146,9 +146,6 @@ QQnxIntegration::QQnxIntegration()
QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection);
#endif
- // Create displays for all possible screens (which may not be attached)
- createDisplays();
-
#if !defined(QT_NO_OPENGL)
// Initialize global OpenGL resources
QQnxGLContext::initialize();
@@ -184,14 +181,25 @@ QQnxIntegration::QQnxIntegration()
#if defined(Q_OS_BLACKBERRY)
QQnxVirtualKeyboardBps* virtualKeyboardBps = new QQnxVirtualKeyboardBps;
m_bpsEventFilter = new QQnxBpsEventFilter(m_navigatorEventHandler, m_screenEventHandler, virtualKeyboardBps);
- Q_FOREACH (QQnxScreen *screen, m_screens)
- m_bpsEventFilter->registerForScreenEvents(screen);
-
m_bpsEventFilter->installOnEventDispatcher(m_eventDispatcher);
m_virtualKeyboard = virtualKeyboardBps;
#endif
+ // Create displays for all possible screens (which may not be attached). We have to do this
+ // *after* the call to m_bpsEventFilter->installOnEventDispatcher(m_eventDispatcher). The
+ // reason for this is that we have to be registered for NAVIGATOR events before we create the
+ // QQnxScreen objects, and hence the QQnxRootWindow's. It is when the NAVIGATOR service sees
+ // the window creation that it starts sending us messages which results in a race if we
+ // create the displays first.
+ createDisplays();
+
+#if defined(Q_OS_BLACKBERRY)
+ // Register for screen domain events with bps
+ Q_FOREACH (QQnxScreen *screen, m_screens)
+ m_bpsEventFilter->registerForScreenEvents(screen);
+#endif
+
if (m_virtualKeyboard) {
// TODO check if we need to do this for all screens or only the primary one
QObject::connect(m_virtualKeyboard, SIGNAL(heightChanged(int)),