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>
This commit is contained in:
Thomas McGuire 2012-04-02 12:04:53 +02:00 committed by Qt by Nokia
parent dee26fe973
commit 2438bf079d
2 changed files with 5 additions and 9 deletions

View File

@ -223,8 +223,9 @@ void QQnxScreen::removeWindow(QQnxWindow *window)
qDebug() << Q_FUNC_INFO << "window =" << window; qDebug() << Q_FUNC_INFO << "window =" << window;
#endif #endif
m_childWindows.removeAll(window); const int numWindowsRemoved = m_childWindows.removeAll(window);
updateHierarchy(); if (numWindowsRemoved > 0)
updateHierarchy();
} }
void QQnxScreen::raiseWindow(QQnxWindow *window) void QQnxScreen::raiseWindow(QQnxWindow *window)

View File

@ -123,9 +123,6 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
setScreen(static_cast<QQnxScreen *>(window->screen()->handle())); 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 // Add window to plugin's window mapper
QQnxIntegration::addWindow(m_window, window); QQnxIntegration::addWindow(m_window, window);
} }
@ -415,11 +412,9 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
if (m_screen == platformScreen) if (m_screen == platformScreen)
return; return;
if (m_screen && m_screen->findWindow(m_window)) { if (m_screen)
m_screen->removeWindow(this); m_screen->removeWindow(this);
platformScreen->addWindow(this); platformScreen->addWindow(this);
}
m_screen = platformScreen; m_screen = platformScreen;
// Move window to proper screen/display // Move window to proper screen/display