From b5a91cdfe08cbeebb1e39ddb29ed2fa5662cfa22 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Fri, 14 Sep 2018 12:54:40 +0200 Subject: [PATCH] Float position values in drag input filter Summary: We lost information when using QMouseEvent::globalPos, since it is integer. Use instead InputRedirection::globalPointer, which is updated before the filters are processed and is float. Test Plan: Manually. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: anthonyfieroni, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D15502 --- input.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input.cpp b/input.cpp index 8002bffd9a..fd735b96aa 100644 --- a/input.cpp +++ b/input.cpp @@ -1445,20 +1445,20 @@ public: seat->setTimestamp(event->timestamp()); switch (event->type()) { case QEvent::MouseMove: { - if (Toplevel *t = input()->findToplevel(event->globalPos())) { + const auto pos = input()->globalPointer(); + seat->setPointerPos(pos); + if (Toplevel *t = input()->findToplevel(pos.toPoint())) { // TODO: consider decorations if (t->surface() != seat->dragSurface()) { if (AbstractClient *c = qobject_cast(t)) { workspace()->activateClient(c); } - seat->setPointerPos(event->globalPos()); - seat->setDragTarget(t->surface(), event->globalPos(), t->inputTransformation()); + seat->setDragTarget(t->surface(), t->inputTransformation()); } } else { // no window at that place, if we have a surface we need to reset seat->setDragTarget(nullptr); } - seat->setPointerPos(event->globalPos()); break; } case QEvent::MouseButtonPress: