Commit d78c89f0 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

xdgshellclient: fix moveresize with touch and CSD

When moveresize is done with touch we need to use the current touch
point and not the mouse position.

BUG: 438283
CCBUG: 431489
(cherry picked from commit f54d7a26)
parent cc3e8997
......@@ -21,6 +21,7 @@
#if KWIN_BUILD_ACTIVITIES
#include "activities.h"
#endif
#include "touch_input.h"
#include <KDecoration2/DecoratedClient>
#include <KDecoration2/Decoration>
......@@ -993,7 +994,13 @@ void XdgToplevelClient::handleMoveRequested(SeatInterface *seat, quint32 serial)
return;
}
if (isMovable()) {
performMouseCommand(Options::MouseMove, Cursors::self()->mouse()->pos());
QPoint cursorPos;
if (seat->hasImplicitPointerGrab(serial)) {
cursorPos = Cursors::self()->mouse()->pos();
} else {
cursorPos = input()->touch()->position().toPoint();
}
performMouseCommand(Options::MouseMove, cursorPos);
} else {
qCDebug(KWIN_CORE) << this << "is immovable, ignoring the move request";
}
......@@ -1011,7 +1018,13 @@ void XdgToplevelClient::handleResizeRequested(SeatInterface *seat, Qt::Edges edg
finishMoveResize(false);
}
setMoveResizePointerButtonDown(true);
setMoveOffset(Cursors::self()->mouse()->pos() - pos()); // map from global
QPoint cursorPos;
if (seat->hasImplicitPointerGrab(serial)) {
cursorPos = Cursors::self()->mouse()->pos();
} else {
cursorPos = input()->touch()->position().toPoint();
}
setMoveOffset(cursorPos - pos()); // map from global
setInvertedMoveOffset(rect().bottomRight() - moveOffset());
setUnrestrictedMoveResize(false);
auto toPosition = [edges] {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment