diff options
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 46 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.h | 6 |
4 files changed, 30 insertions, 34 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index a758bdf7f4..dd7f907ee0 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -139,6 +139,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) platformWindow()->adjustBufferSize(); if (window()->requestedFormat().alphaBufferSize() > 0) { + auto platformScreen = static_cast<QQnxScreen *>(platformWindow()->screen()); for (const QRect &r : region) { // Clear transparent regions const int bg[] = { @@ -149,11 +150,11 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) SCREEN_BLIT_DESTINATION_HEIGHT, r.height(), SCREEN_BLIT_END }; - Q_SCREEN_CHECKERROR(screen_fill(platformWindow()->screen()->nativeContext(), + Q_SCREEN_CHECKERROR(screen_fill(platformScreen->nativeContext(), platformWindow()->renderBuffer().nativeBuffer(), bg), "failed to clear transparent regions"); } - Q_SCREEN_CHECKERROR(screen_flush_blits(platformWindow()->screen()->nativeContext(), + Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(), SCREEN_WAIT_IDLE), "failed to flush blits"); } } diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index 7f11de228e..dc844189d1 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -141,6 +141,7 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer() // Check if render buffer is invalid if (m_currentBufferIndex == -1) { + auto platformScreen = static_cast<QQnxScreen *>(screen()); // Get all buffers available for rendering screen_buffer_t buffers[MAX_BUFFER_COUNT]; const int result = screen_get_window_property_pv(nativeHandle(), SCREEN_PROPERTY_RENDER_BUFFERS, @@ -153,11 +154,11 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer() // Clear Buffer int bg[] = { SCREEN_BLIT_COLOR, 0x00000000, SCREEN_BLIT_END }; - Q_SCREEN_CHECKERROR(screen_fill(screen()->nativeContext(), buffers[i], bg), + Q_SCREEN_CHECKERROR(screen_fill(platformScreen->nativeContext(), buffers[i], bg), "Failed to clear window buffer"); } - Q_SCREEN_CHECKERROR(screen_flush_blits(screen()->nativeContext(), 0), + Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(), 0), "Failed to flush blits"); // Use the first available render buffer @@ -185,7 +186,7 @@ void QQnxRasterWindow::adjustBufferSize() int QQnxRasterWindow::pixelFormat() const { - return screen()->nativeFormat(); + return static_cast<QQnxScreen *>(screen())->nativeFormat(); } void QQnxRasterWindow::resetBuffers() diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 30288ccb20..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; } @@ -586,7 +587,7 @@ void QQnxWindow::setFocus(screen_window_t newFocusWindow) } } -void QQnxWindow::setWindowState(Qt::WindowState state) +void QQnxWindow::setWindowState(Qt::WindowStates state) { qWindowDebug() << "state =" << state; @@ -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) @@ -749,32 +755,19 @@ void QQnxWindow::updateZorder(screen_window_t window, int &topZorder) void QQnxWindow::applyWindowState() { - switch (m_windowState) { - - // WindowActive is not an accepted parameter according to the docs - case Qt::WindowActive: - return; - - case Qt::WindowMinimized: + if (m_windowState & Qt::WindowMinimized) { minimize(); if (m_unmaximizedGeometry.isValid()) setGeometry(m_unmaximizedGeometry); else setGeometry(m_screen->geometry()); - - break; - - case Qt::WindowMaximized: - case Qt::WindowFullScreen: + } else if (m_windowState & (Qt::WindowMaximized | Qt::WindowFullScreen)) { m_unmaximizedGeometry = geometry(); - setGeometry(m_windowState == Qt::WindowMaximized ? m_screen->availableGeometry() : m_screen->geometry()); - break; - - case Qt::WindowNoState: - if (m_unmaximizedGeometry.isValid()) - setGeometry(m_unmaximizedGeometry); - break; + setGeometry(m_windowState & Qt::WindowFullScreen ? m_screen->geometry() + : m_screen->availableGeometry()); + } else if (m_unmaximizedGeometry.isValid()) { + setGeometry(m_unmaximizedGeometry); } } @@ -788,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 diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index 223ea6e349..2895a547b1 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -85,7 +85,7 @@ public: void raise() override; void lower() override; void requestActivateWindow() override; - void setWindowState(Qt::WindowState state) override; + void setWindowState(Qt::WindowStates state) override; void setExposed(bool exposed); void propagateSizeHints() override; @@ -94,7 +94,7 @@ public: void setMMRendererWindow(screen_window_t handle); void clearMMRendererWindow(); - QQnxScreen *screen() const { return m_screen; } + QPlatformScreen *screen() const override; const QList<QQnxWindow*>& children() const { return m_childWindows; } QQnxWindow *findWindow(screen_window_t windowHandle); @@ -142,7 +142,7 @@ private: bool m_visible; bool m_exposed; QRect m_unmaximizedGeometry; - Qt::WindowState m_windowState; + Qt::WindowStates m_windowState; QString m_mmRendererWindowName; screen_window_t m_mmRendererWindow; |