diff options
authorRafael Roquetto <>2014-02-23 12:36:53 -0300
committerThe Qt Project <>2014-02-25 21:51:07 +0100
commit45e17d0cc74d3444e23c18f73d6ac155659cec55 (patch)
parent97ed8f3c0ff300cd8d4b3c75b91f89e6ee355e10 (diff)
QNX: Prevent desktop windows from becoming root windowv5.3.0-alpha1
If a QDesktopWidget is created before any other window, its underlying QPlatformWindow will be granted the root window role. Windows created afterwards will become children of the root window, preventing the app from being rendered, since the Qt::Desktop windows never get posted and therefore flushed. This patch prevents a Qt::Desktop window (related to QDesktopWidget) from becoming the root window. This does not affect QDesktopWidget functionality. Change-Id: I02c9946a3979b2227afbd2e5d485ba80efa1b997 Reviewed-by: Fabian Bumberger <>
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index e57025cbc6..f2b57aec9a 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -88,8 +88,10 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
QQnxScreen *platformScreen = static_cast<QQnxScreen *>(window->screen()->handle());
- if (window->type() == Qt::CoverWindow) {
+ if (window->type() == Qt::CoverWindow || window->type() == Qt::Desktop) {
// Cover windows have to be top level to be accessible to window delegate (i.e. navigator)
+ // Desktop windows also need to be toplevel because they are not
+ // supposed to be part of the window hierarchy tree
m_isTopLevel = true;
} else if (parent() || (window->type() & Qt::Dialog) == Qt::Dialog) {
// If we have a parent we are a child window. Sometimes we have to be a child even if we
@@ -104,7 +106,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
if (m_isTopLevel) {
Q_SCREEN_CRITICALERROR(screen_create_window(&m_window, m_screenContext),
"Could not create top level window"); // Creates an application window
- if (window->type() != Qt::CoverWindow) {
+ if (window->type() != Qt::CoverWindow && window->type() != Qt::Desktop) {
if (needRootWindow)