summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorAlexander Volkov <avolkov@astralinux.ru>2020-04-30 15:15:12 +0300
committerAlexander Volkov <avolkov@astralinux.ru>2020-05-14 15:19:47 +0300
commitaf3caa2271f47ddf48da46a0cc5932aaa442eb39 (patch)
treee1e3010b22bc7bc50eabf7324063c254ba4d09f1 /src/gui/kernel
parent45ed28a9d3790707b18798454d976f3a818a7740 (diff)
QBasicDrag: Send QDragMoveEvent when modifiers change
... without moving the mouse. This allows to update drop action and cursor. Task-number: QTBUG-56218 Task-number: QTBUG-82934 Pick-to: 5.15 Change-Id: I8b0ac2a008a9dbcc4c2d6abce282e6f169c2f542 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qsimpledrag.cpp7
-rw-r--r--src/gui/kernel/qsimpledrag_p.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index dec3cc399d..55e92d2a5d 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -145,15 +145,17 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
disableEventFilter();
exitDndEventLoop();
+ } else if (ke->modifiers() != QGuiApplication::keyboardModifiers()) {
+ move(m_lastPos, QGuiApplication::mouseButtons(), ke->modifiers());
}
return true; // Eat all key events
}
case QEvent::MouseMove:
{
- QPoint nativePosition = getNativeMousePos(e, m_drag_icon_window);
+ m_lastPos = getNativeMousePos(e, m_drag_icon_window);
auto mouseMove = static_cast<QMouseEvent *>(e);
- move(nativePosition, mouseMove->buttons(), mouseMove->modifiers());
+ move(m_lastPos, mouseMove->buttons(), mouseMove->modifiers());
return true; // Eat all mouse move events
}
case QEvent::MouseButtonRelease:
@@ -230,6 +232,7 @@ void QBasicDrag::startDrag()
pos = QPoint();
}
#endif
+ m_lastPos = pos;
recreateShapedPixmapWindow(m_screen, pos);
enableEventFilter();
}
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 8638b05155..4409deb1da 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -126,6 +126,7 @@ private:
QShapedPixmapWindow *m_drag_icon_window = nullptr;
bool m_useCompositing = true;
QScreen *m_screen = nullptr;
+ QPoint m_lastPos;
};
class Q_GUI_EXPORT QSimpleDrag : public QBasicDrag