diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2017-04-25 14:22:13 +0200 |
---|---|---|
committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2017-09-04 11:36:50 +0000 |
commit | 3f1ac5899476307923686166705812c24a2e3578 (patch) | |
tree | eaeb3d40be3d97e9161977a31825f13f07293d0c /src/plugins/platforms/qnx/qqnxwindow.cpp | |
parent | fefdb8466265d632675c50c53a027a86ca1af4a2 (diff) |
Add QPlatformSurface::screen() const
Classes inheriting QPlatformSurface need to return the QPlatformScreen
to allow the platform integration plugin to know information about the
used screen by the surface.
QPlatformSurface and QPlatformWindow had the same function defined, but
it was not possible to call it without casting the QPlatformSurface
pointer.
Change-Id: I1f93fe7c13ebbc51769677038edeca4de5db0024
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxwindow.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 2253e3b23d..38b61fd782 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -479,7 +479,7 @@ void QQnxWindow::setParent(const QPlatformWindow *window) if (newParent == m_parentWindow) return; - if (screen()->rootWindow() == this) { + if (static_cast<QQnxScreen *>(screen())->rootWindow() == this) { qWarning("Application window cannot be reparented"); return; } @@ -539,7 +539,7 @@ void QQnxWindow::requestActivateWindow() if (focusWindow == this) return; - if (screen()->rootWindow() == this || + if (static_cast<QQnxScreen *>(screen())->rootWindow() == this || (focusWindow && findWindow(focusWindow->nativeHandle()))) { // If the focus window is a child, we can just set the focus of our own window // group to our window handle @@ -550,6 +550,7 @@ void QQnxWindow::requestActivateWindow() QQnxWindow *currentWindow = this; QList<QQnxWindow*> windowList; while (currentWindow) { + auto platformScreen = static_cast<QQnxScreen *>(screen()); windowList.prepend(currentWindow); // If we find the focus window, we don't have to go further if (currentWindow == focusWindow) @@ -557,9 +558,9 @@ void QQnxWindow::requestActivateWindow() if (currentWindow->parent()){ currentWindow = static_cast<QQnxWindow*>(currentWindow->parent()); - } else if (screen()->rootWindow() && - screen()->rootWindow()->m_windowGroupName == currentWindow->m_parentGroupName) { - currentWindow = screen()->rootWindow(); + } else if (platformScreen->rootWindow() && + platformScreen->rootWindow()->m_windowGroupName == currentWindow->m_parentGroupName) { + currentWindow = platformScreen->rootWindow(); } else { currentWindow = 0; } @@ -622,6 +623,11 @@ void QQnxWindow::clearMMRendererWindow() m_mmRendererWindow = 0; } +QPlatformScreen *QQnxWindow::screen() const +{ + return m_screen; +} + QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle) { if (m_window == windowHandle) @@ -775,7 +781,8 @@ void QQnxWindow::windowPosted() bool QQnxWindow::shouldMakeFullScreen() const { - return ((screen()->rootWindow() == this) && (QQnxIntegration::options() & QQnxIntegration::FullScreenApplication)); + return ((static_cast<QQnxScreen *>(screen())->rootWindow() == this) + && (QQnxIntegration::options() & QQnxIntegration::FullScreenApplication)); } QT_END_NAMESPACE |