summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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)),