Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b5a91cdf authored by Roman Gilg's avatar Roman Gilg

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
parent 29513814
......@@ -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<AbstractClient*>(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:
......
Markdown is supported
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