path: root/src/gui/kernel/qsimpledrag.cpp
diff options
authorUlf Hermann <>2015-09-22 17:22:22 +0200
committerUlf Hermann <>2015-09-24 12:16:50 +0000
commit17650467302819e1fd333f0682445d50fc52eb68 (patch)
tree744e5daac8c84fe4ad1937afc4a3074e6e7dead8 /src/gui/kernel/qsimpledrag.cpp
parent73b8cd879cd723fbcce42e63f21cc864d13cb91e (diff)
Deliver mouse press and release events on X11 also when dragging
We generally assume that for every mouse press we also get a mouse release eventually. The event filter installed by QBasicDrag broke this assumption as it didn't take care of filtering mouse press and mouse release events symmetrically. We cannot immediately pass on the release event as that would mean a release event is generated from a press event (via the blocking drag call), which breaks assumptions in other places. Change-Id: If7e48c7dc0ef5265bed4f9a9366a7606ec875d93 Task-number: QTBUG-46361 Reviewed-by: Friedemann Kleint <> Reviewed-by: Gatis Paeglis <>
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 6e574d82e4..b02f1dd8bd 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -149,7 +149,7 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
QPoint nativePosition = getNativeMousePos(e, o);
- return true; // Eat all mouse events
+ return true; // Eat all mouse move events
case QEvent::MouseButtonRelease:
@@ -160,8 +160,8 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
- return true; // Eat all mouse events
- case QEvent::MouseButtonPress:
+ QCoreApplication::postEvent(o, new QMouseEvent(*static_cast<QMouseEvent *>(e)));
+ return true; // defer mouse release events until drag event loop has returned
case QEvent::MouseButtonDblClick:
case QEvent::Wheel:
return true;