diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-06-16 23:32:48 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-06-19 04:58:02 +0000 |
commit | c704fff20bde135ef6fcab90b1509607b38a545d (patch) | |
tree | 271803a0ec9c57e362d9e3a47102a9172843039f /src/client/qwaylandwindow.cpp | |
parent | 07144e3accf545ca34f3a181ead05eed27b5b018 (diff) |
Client: Don't restore content cursor when on the window decorations
Problem: When the cursor entered the window decorations,
QWaylandWindow::restoreMouseCursor would be called from the pointer
enter handler messing up the cursor from the decorations, making the
resize border seemingly hard to hit.
Don't restore the cursor unless inside the window contents.
[ChangeLog][QPA plugin] Fixed a bug where the arrow cursor would be
shown instead of the resize cursor when hovering over the window
decoration border.
Change-Id: I2fabd8d626deaa7006734a4d5c6d10d6c0114466
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index e07133063..17602626b 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -804,8 +804,13 @@ void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylan } #if QT_CONFIG(cursor) - if (e.type == QWaylandPointerEvent::Enter) - restoreMouseCursor(inputDevice); + if (e.type == QWaylandPointerEvent::Enter) { + QRect windowGeometry = window()->frameGeometry(); + windowGeometry.moveTopLeft({0, 0}); // convert to wayland surface coordinates + QRect contentGeometry = windowGeometry.marginsRemoved(frameMargins()); + if (contentGeometry.contains(e.local.toPoint())) + restoreMouseCursor(inputDevice); + } #endif } |