diff options
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxwindow.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index e0fff0cd6a..66eb1cf777 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -124,7 +124,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) setScreen(static_cast<QQnxScreen *>(window->screen()->handle())); // Add the window to the root of the hierarchy - QQnxScreen::addWindow(this); + m_screen->addWindow(this); // Add window to plugin's window mapper QQnxIntegration::addWindow(m_window, window); @@ -140,7 +140,7 @@ QQnxWindow::~QQnxWindow() // Remove from parent's Hierarchy. removeFromParent(); - QQnxScreen::updateHierarchy(); + m_screen->updateHierarchy(); // We shouldn't allow this case unless QT allows it. Does it? Or should we send the // handleCloseEvent on all children when this window is deleted? @@ -415,6 +415,11 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen) if (m_screen == platformScreen) return; + if (m_screen && m_screen->findWindow(m_window)) { + m_screen->removeWindow(this); + platformScreen->addWindow(this); + } + m_screen = platformScreen; // Move window to proper screen/display @@ -440,7 +445,7 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen) (*it)->setScreen(platformScreen); } - QQnxScreen::updateHierarchy(); + m_screen->updateHierarchy(); } void QQnxWindow::removeFromParent() @@ -455,7 +460,7 @@ void QQnxWindow::removeFromParent() else qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child."); } else { - QQnxScreen::removeWindow(this); + m_screen->removeWindow(this); } } @@ -483,10 +488,10 @@ void QQnxWindow::setParent(const QPlatformWindow *window) m_parentWindow->m_childWindows.push_back(this); } else { - QQnxScreen::addWindow(this); + m_screen->addWindow(this); } - QQnxScreen::updateHierarchy(); + m_screen->updateHierarchy(); } void QQnxWindow::raise() @@ -500,10 +505,10 @@ void QQnxWindow::raise() removeFromParent(); oldParent->m_childWindows.push_back(this); } else { - QQnxScreen::raiseWindow(this); + m_screen->raiseWindow(this); } - QQnxScreen::updateHierarchy(); + m_screen->updateHierarchy(); } void QQnxWindow::lower() @@ -517,10 +522,10 @@ void QQnxWindow::lower() removeFromParent(); oldParent->m_childWindows.push_front(this); } else { - QQnxScreen::lowerWindow(this); + m_screen->lowerWindow(this); } - QQnxScreen::updateHierarchy(); + m_screen->updateHierarchy(); } void QQnxWindow::requestActivateWindow() @@ -552,6 +557,20 @@ void QQnxWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext) m_platformOpenGLContext = platformOpenGLContext; } +QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle) +{ + if (m_window == windowHandle) + return this; + + Q_FOREACH (QQnxWindow *window, m_childWindows) { + QQnxWindow * const result = window->findWindow(windowHandle); + if (result) + return result; + } + + return 0; +} + void QQnxWindow::updateZorder(int &topZorder) { errno = 0; |