From 7e5daff5dd6eed810e6931075ca17bc113f465d8 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Sat, 16 Jun 2018 23:32:48 +0200 Subject: [PATCH] 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 --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index e071330634f..17602626b71 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/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 }