summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire@kdab.com>2012-04-02 12:04:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-03 12:45:46 +0200
commit2438bf079db1230f5407f455d1d306cd6323939d (patch)
tree767b42171ebd32588ab8b396b89704aa9c7978f2 /src/plugins
parentdee26fe973083f8e94fcf5bcbb7fedbe5c35edfd (diff)
Fix adding and removing of windows to their screen
Change-Id: I5e0edf1515db60689c86b16b978863ae9e49bfdb Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp5
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp9
2 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 7ae1988bff..7ddef321ae 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -223,8 +223,9 @@ void QQnxScreen::removeWindow(QQnxWindow *window)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
- m_childWindows.removeAll(window);
- updateHierarchy();
+ const int numWindowsRemoved = m_childWindows.removeAll(window);
+ if (numWindowsRemoved > 0)
+ updateHierarchy();
}
void QQnxScreen::raiseWindow(QQnxWindow *window)
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 66eb1cf777..4ca084fa8f 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -123,9 +123,6 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
setScreen(static_cast<QQnxScreen *>(window->screen()->handle()));
- // Add the window to the root of the hierarchy
- m_screen->addWindow(this);
-
// Add window to plugin's window mapper
QQnxIntegration::addWindow(m_window, window);
}
@@ -415,11 +412,9 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
if (m_screen == platformScreen)
return;
- if (m_screen && m_screen->findWindow(m_window)) {
+ if (m_screen)
m_screen->removeWindow(this);
- platformScreen->addWindow(this);
- }
-
+ platformScreen->addWindow(this);
m_screen = platformScreen;
// Move window to proper screen/display