summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsimpledrag.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
-rw-r--r--src/gui/kernel/qsimpledrag.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index fc62273325..a1e25dc53c 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -117,9 +117,9 @@ void QBasicDrag::disableEventFilter()
}
-static inline QPoint getNativeMousePos(QEvent *e, QObject *o)
+static inline QPoint getNativeMousePos(QEvent *e, QWindow *window)
{
- return QHighDpi::toNativePixels(static_cast<QMouseEvent *>(e)->globalPos(), qobject_cast<QWindow*>(o));
+ return QHighDpi::toNativePixels(static_cast<QMouseEvent *>(e)->globalPos(), window);
}
bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
@@ -156,14 +156,14 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
case QEvent::MouseMove:
{
- QPoint nativePosition = getNativeMousePos(e, o);
+ QPoint nativePosition = getNativeMousePos(e, m_drag_icon_window);
move(nativePosition);
return true; // Eat all mouse move events
}
case QEvent::MouseButtonRelease:
disableEventFilter();
if (canDrop()) {
- QPoint nativePosition = getNativeMousePos(e, o);
+ QPoint nativePosition = getNativeMousePos(e, m_drag_icon_window);
drop(nativePosition);
} else {
cancel();