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
This commit is contained in:
parent
295138145c
commit
b5a91cdfe0
1 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue