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:
parent
dee26fe973
commit
2438bf079d
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user