| | |
| | | // Copyright (C) 2023-2024 Stdware Collections |
| | | // Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware) |
| | | // Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao) |
| | | // SPDX-License-Identifier: Apache-2.0 |
| | | |
| | | #ifndef SYSTEMWINDOW_P_H |
| | |
| | | |
| | | #include <QWKCore/private/qwkglobal_p.h> |
| | | |
| | | // Don't include this header in any header files. |
| | | |
| | | namespace QWK { |
| | | |
| | | // Anonymous namespace |
| | | namespace { |
| | | |
| | | class WindowMoveManipulator : public QObject { |
| | | public: |
| | |
| | | Qt::Edges resizeEdges; |
| | | }; |
| | | |
| | | } |
| | | |
| | | // QWindow::startSystemMove() and QWindow::startSystemResize() is first supported at Qt 5.15 |
| | | // QWindow::startSystemResize() returns false on macOS |
| | | // QWindow::startSystemMove() and QWindow::startSystemResize() returns false on Linux Unity DE |
| | | |
| | | // When the new API fails, we emulate the window actions using the classical API. |
| | | |
| | | static inline void startSystemMove(QWindow *window) { |
| | | inline void startSystemMove(QWindow *window) { |
| | | #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) |
| | | std::ignore = new WindowMoveManipulator(window); |
| | | #elif defined(Q_OS_LINUX) |
| | |
| | | #endif |
| | | } |
| | | |
| | | static inline void startSystemResize(QWindow *window, Qt::Edges edges) { |
| | | inline void startSystemResize(QWindow *window, Qt::Edges edges) { |
| | | #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) |
| | | std::ignore = new WindowResizeManipulator(window, edges); |
| | | #elif defined(Q_OS_MAC) || defined(Q_OS_LINUX) |