summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbintegration.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-05-22 16:33:53 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2018-06-25 12:45:47 +0000
commit7a7c722782a435f7c01b94f48df7a5f4ff4d599e (patch)
tree63f1261126d502e05f0d396822ba6ebee4e1d323 /src/plugins/platforms/xcb/qxcbintegration.cpp
parentca3460775cadd055792457eab42bd8783b1df795 (diff)
dnd: send DragEnter and DragMove on DnD start
This was a regression from Qt4 and also is the documented behavior. In addition this patch fixes various issues with cursor shape updating that were discovered along the way and that are necessary for testing the new changes. The code in QGuiApplicationPrivate::processDrag() also needed a fixup, particularly the resetting of QGuiApplicationPrivate::currentDragWindow. Without this fix we would get DragMove (the one that immediately follows the DragEnter) only for the first DragEnter event. For example when dnd starts on mouse press then for mouse click we would get: <click> DragEnter->DragMove->DragLeave <click> DragEnter->DragLeave but the expected is: <click> DragEnter->DragMove->DragLeave <click> DragEnter->DragMove->DragLeave Task-number: QTBUG-34331 Change-Id: I3cc96c87d1fd5d1342c7f6c9438802ab30076e9e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index b8a0e85465..49649eb816 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -379,8 +379,17 @@ QPlatformClipboard *QXcbIntegration::clipboard() const
#endif
#if QT_CONFIG(draganddrop)
+#include <private/qsimpledrag_p.h>
QPlatformDrag *QXcbIntegration::drag() const
{
+ static const bool useSimpleDrag = qEnvironmentVariableIsSet("QT_XCB_USE_SIMPLE_DRAG");
+ if (Q_UNLIKELY(useSimpleDrag)) { // This is useful for testing purposes
+ static QSimpleDrag *simpleDrag = nullptr;
+ if (!simpleDrag)
+ simpleDrag = new QSimpleDrag();
+ return simpleDrag;
+ }
+
return m_connections.at(0)->drag();
}
#endif