|author||Johan Klokkhammer Helsing <email@example.com>||2018-02-06 17:21:13 +0100|
|committer||Johan Klokkhammer Helsing <firstname.lastname@example.org>||2020-01-28 16:52:13 +0100|
Add QWindow::startSystemMove and startSystemResize
This can be used to create custom client side window decorations. Refactors the xcb implementation to use edges instead of corners and we now use the last mouse position for `root_x` and `root_y` in the `_NET_WM_MOVERESIZE` event. Touch has also been changed, so just pick a point that's currently being pressed. The workaround for QTBUG-69716 has now been moved to QSizeGrip, as the comment in the bug report says that it should ideally be fixed at the widget level. On Windows, we no longer abort when GetSystemMenu returns false. I assume this code was added to check whether the window didn't have any decorations and not resize in that case. However, since the point of this patch is to let windows without native decorations resize/move, it makes most sense to remove the check. Adds a manual test, which calls QWindow::startSystemMove and startSystemResize on touch and mouse events. [ChangeLog][QtGui] Added API for starting interactive window resize and move operations handled by the system. Fixes: QTBUG-73011 Change-Id: I7e47a0b2cff182af71d3d479d6e3746f08ea30aa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <email@example.com> Reviewed-by: Tor Arne Vestbø <firstname.lastname@example.org>
Diffstat (limited to 'src/gui/kernel/qplatformwindow.cpp')
1 files changed, 10 insertions, 17 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 65accc9f68..03f2e4d79e 100644
@@ -482,19 +482,17 @@ bool QPlatformWindow::windowEvent(QEvent *event)
- Reimplement this method to start a system size grip drag
- operation if the system supports it and return true to indicate
- It is called from the mouse press event handler of the size grip.
+ Reimplement this method to start a system resize operation if
+ the system supports it and return true to indicate success.
+ The default implementation is empty and does nothing with \a edges.
- The default implementation is empty and does nothing with \a pos
- and \a corner.
+ \since 5.15
-bool QPlatformWindow::startSystemResize(const QPoint &pos, Qt::Corner corner)
+bool QPlatformWindow::startSystemResize(Qt::Edges edges)
@@ -502,18 +500,13 @@ bool QPlatformWindow::startSystemResize(const QPoint &pos, Qt::Corner corner)
Reimplement this method to start a system move operation if
the system supports it and return true to indicate success.
- The \a pos is a position of MouseButtonPress event or TouchBegin
- event from a sequence of mouse events that triggered the movement.
- It must be specified in window coordinates.
- The default implementation is empty and does nothing with \a pos.
+ The default implementation is empty and does nothing.
- \since 5.11
+ \since 5.15
-bool QPlatformWindow::startSystemMove(const QPoint &pos)