From 45e17d0cc74d3444e23c18f73d6ac155659cec55 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Sun, 23 Feb 2014 12:36:53 -0300 Subject: QNX: Prevent desktop windows from becoming root window 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 --- src/plugins/platforms/qnx/qqnxwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins') 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(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) platformScreen->setRootWindow(this); } -- cgit v1.2.3