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.
This commit is contained in:
Vlad Zahorodnii 2022-11-24 00:12:52 +02:00
parent 777c2bdb18
commit 0987b55cdd

View file

@ -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();
}