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 <fbumberger@rim.com>
This commit is contained in:
Rafael Roquetto 2014-02-23 12:36:53 -03:00 committed by The Qt Project
parent 97ed8f3c0f
commit 45e17d0cc7

View File

@ -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)
platformScreen->setRootWindow(this);
}