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.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 090e88c118..b850f53014 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -201,7 +201,16 @@ void QBasicDrag::startDrag()
m_drag_icon_window->setPixmap(m_drag->pixmap());
m_drag_icon_window->setHotspot(m_drag->hotSpot());
- m_drag_icon_window->updateGeometry();
+
+#ifndef QT_NO_CURSOR
+ QPoint pos = QCursor::pos();
+ if (pos.x() == int(qInf())) {
+ // ### fixme: no mouse pos registered. Get pos from touch...
+ pos = QPoint();
+ }
+ m_drag_icon_window->updateGeometry(pos);
+#endif
+
m_drag_icon_window->setVisible(true);
enableEventFilter();
@@ -218,10 +227,10 @@ void QBasicDrag::cancel()
m_drag_icon_window->setVisible(false);
}
-void QBasicDrag::move(const QMouseEvent *)
+void QBasicDrag::move(const QMouseEvent *e)
{
if (m_drag)
- m_drag_icon_window->updateGeometry();
+ m_drag_icon_window->updateGeometry(e->globalPos());
}
void QBasicDrag::drop(const QMouseEvent *)