summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qsimpledrag.cpp9
-rw-r--r--src/gui/kernel/qsimpledrag_p.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp5
3 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 162dbfee20..6e574d82e4 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -236,7 +236,12 @@ void QBasicDrag::cancel()
m_drag_icon_window->setVisible(false);
}
-void QBasicDrag::move(const QPoint &globalPos)
+/*!
+ Move the drag label to \a globalPos, which is
+ interpreted in device independent coordinates. Typically called from reimplementations of move().
+ */
+
+void QBasicDrag::moveShapedPixmapWindow(const QPoint &globalPos)
{
if (m_drag)
m_drag_icon_window->updateGeometry(globalPos);
@@ -342,7 +347,7 @@ void QSimpleDrag::cancel()
void QSimpleDrag::move(const QPoint &globalPos)
{
//### not high-DPI aware
- QBasicDrag::move(globalPos);
+ moveShapedPixmapWindow(globalPos);
QWindow *window = topLevelAt(globalPos);
if (!window)
return;
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 728ae7bd15..a011475381 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -77,6 +77,8 @@ protected:
virtual void drop(const QPoint &globalPos) = 0;
virtual void endDrag();
+
+ void moveShapedPixmapWindow(const QPoint &deviceIndependentPosition);
QShapedPixmapWindow *shapedPixmapWindow() const { return m_drag_icon_window; }
void updateCursor(Qt::DropAction action);
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index 8d4878e12e..7cd9cafa8e 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -51,6 +51,7 @@
#include <private/qshapedpixmapdndwindow_p.h>
#include <private/qsimpledrag_p.h>
+#include <private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -303,7 +304,6 @@ xcb_window_t QXcbDrag::findRealWindow(const QPoint & pos, xcb_window_t w, int md
void QXcbDrag::move(const QPoint &globalPos)
{
- QBasicDrag::move(globalPos);
if (source_sameanswer.contains(globalPos) && source_sameanswer.isValid())
return;
@@ -316,6 +316,9 @@ void QXcbDrag::move(const QPoint &globalPos)
break;
}
}
+
+ QBasicDrag::moveShapedPixmapWindow(QHighDpiScaling::mapPositionFromNative(globalPos, screen));
+
if (screen != current_screen) {
// ### need to recreate the shaped pixmap window?
// int screen = QCursor::x11Screen();