diff --git a/input.cpp b/input.cpp index 55898e1cfd..dc6fd4669a 100644 --- a/input.cpp +++ b/input.cpp @@ -702,22 +702,22 @@ void InputRedirection::processPointerMotion(const QPointF &pos, uint32_t time) return; } + // first update to new mouse position +// const QPointF oldPos = m_globalPointer; + updatePointerPosition(pos); + if (waylandServer()->isScreenLocked()) { - Toplevel *t = findToplevel(pos.toPoint()); + Toplevel *t = findToplevel(m_globalPointer.toPoint()); if (t && t->surface()) { if (auto seat = findSeat()) { seat->setFocusedPointerSurface(t->surface(), t->pos()); seat->setTimestamp(time); - seat->setPointerPos(pos); + seat->setPointerPos(m_globalPointer); } } return; } - // first update to new mouse position -// const QPointF oldPos = m_globalPointer; - updatePointerPosition(pos); - // TODO: check which part of KWin would like to intercept the event QMouseEvent event(QEvent::MouseMove, m_globalPointer.toPoint(), m_globalPointer.toPoint(), Qt::NoButton, qtButtonStates(), keyboardModifiers()); diff --git a/screenedge.cpp b/screenedge.cpp index db9a648817..05e1b983ee 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -39,6 +39,9 @@ along with this program. If not, see . #include "utils.h" #include #include "virtualdesktops.h" +#ifndef KWIN_UNIT_TEST +#include "wayland_server.h" +#endif // DBus generated #include "screenlocker_interface.h" // frameworks @@ -599,6 +602,11 @@ AreaBasedEdge::~AreaBasedEdge() void AreaBasedEdge::pointerPosChanged(const QPointF &pos) { +#ifndef KWIN_UNIT_TEST + if (waylandServer() && waylandServer()->isScreenLocked()) { + return; + } +#endif if (!isReserved()) { return; }