From 0987b55cdd9d35f408f216edca98b7a191107f8f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 24 Nov 2022 00:12:52 +0200 Subject: [PATCH] wayland: Prefer input()->pointer()->pos() over cursor pos On Wayland, the cursor primarily visual role, not functional. Interactive move resize should get the position from the corresponding input device. --- src/xdgshellwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 956a40ec5d..5cf9ae6573 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -16,6 +16,7 @@ #include "decorations/decorationbridge.h" #include "deleted.h" #include "placement.h" +#include "pointer_input.h" #include "screenedge.h" #include "touch_input.h" #include "utils/subsurfacemonitor.h" @@ -1121,7 +1122,7 @@ void XdgToplevelWindow::handleMoveRequested(SeatInterface *seat, quint32 serial) if (isMovable()) { QPointF cursorPos; if (seat->hasImplicitPointerGrab(serial)) { - cursorPos = Cursors::self()->mouse()->pos(); + cursorPos = input()->pointer()->pos(); } else { cursorPos = input()->touch()->position(); } @@ -1145,7 +1146,7 @@ void XdgToplevelWindow::handleResizeRequested(SeatInterface *seat, XdgToplevelIn setInteractiveMoveResizePointerButtonDown(true); QPointF cursorPos; if (seat->hasImplicitPointerGrab(serial)) { - cursorPos = Cursors::self()->mouse()->pos(); + cursorPos = input()->pointer()->pos(); } else { cursorPos = input()->touch()->position(); }