summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsimpledrag.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2015-10-07 16:58:09 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2015-10-09 15:45:35 +0000
commitc55a36cb9015cf1eebd49eaa5b1b4f4ec9b28451 (patch)
treef24f0fee52d115a44aad001b17b428b0b85de901 /src/gui/kernel/qsimpledrag.cpp
parentde70798859e0363c8ca3133a4ed1a1092cfe47f5 (diff)
xcb: Fix DnD for separate X screens
Recreate QShapedPixmapWindow when the cursor goes to another X screen. Change-Id: Ifd4c4281971b23abc45a9f6c0509832a45c31521 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
-rw-r--r--src/gui/kernel/qsimpledrag.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index b02f1dd8bd..6acac4cade 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -203,25 +203,15 @@ void QBasicDrag::restoreCursor()
void QBasicDrag::startDrag()
{
- // ### TODO Check if its really necessary to have m_drag_icon_window
- // when QDrag is used without a pixmap - QDrag::setPixmap()
- if (!m_drag_icon_window)
- m_drag_icon_window = new QShapedPixmapWindow();
-
- m_drag_icon_window->setPixmap(m_drag->pixmap());
- m_drag_icon_window->setHotspot(m_drag->hotSpot());
-
+ QPoint pos;
#ifndef QT_NO_CURSOR
- QPoint pos = QCursor::pos();
+ 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);
-
+ recreateShapedPixmapWindow(Q_NULLPTR, pos);
enableEventFilter();
}
@@ -229,6 +219,19 @@ void QBasicDrag::endDrag()
{
}
+void QBasicDrag::recreateShapedPixmapWindow(QScreen *screen, const QPoint &pos)
+{
+ delete m_drag_icon_window;
+ // ### TODO Check if its really necessary to have m_drag_icon_window
+ // when QDrag is used without a pixmap - QDrag::setPixmap()
+ m_drag_icon_window = new QShapedPixmapWindow(screen);
+
+ m_drag_icon_window->setPixmap(m_drag->pixmap());
+ m_drag_icon_window->setHotspot(m_drag->hotSpot());
+ m_drag_icon_window->updateGeometry(pos);
+ m_drag_icon_window->setVisible(true);
+}
+
void QBasicDrag::cancel()
{
disableEventFilter();