summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbdrag.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-05-19 11:04:19 +0200
committerLiang Qi <liang.qi@qt.io>2016-05-19 12:55:27 +0200
commit818014b449ef996099b4795a82f09651cf1c0129 (patch)
tree02f991007097fa368491a81eebbabe4cc162a0e0 /src/plugins/platforms/xcb/qxcbdrag.cpp
parente6cc1d788dddda2998a9f941664ede928ce1e212 (diff)
parent640441882d20f86db05ab5fd1141abe39a0bd409 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbdrag.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index b55fbd8f03..fb006ec0f1 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -56,6 +56,7 @@
#include <qpa/qwindowsysteminterface.h>
+#include <private/qguiapplication_p.h>
#include <private/qshapedpixmapdndwindow_p.h>
#include <private/qsimpledrag_p.h>
#include <private/qhighdpiscaling_p.h>
@@ -176,6 +177,17 @@ QMimeData *QXcbDrag::platformDropData()
return dropData;
}
+bool QXcbDrag::eventFilter(QObject *o, QEvent *e)
+{
+ /* We are setting a mouse grab on the QShapedPixmapWindow in order not to
+ * lose the grab when the virtual desktop changes, but
+ * QBasicDrag::eventFilter() expects the events to be coming from the
+ * window where the drag was started. */
+ if (initiatorWindow && o == shapedPixmapWindow())
+ o = initiatorWindow.data();
+ return QBasicDrag::eventFilter(o, e);
+}
+
void QXcbDrag::startDrag()
{
// #fixme enableEventFilter();
@@ -200,6 +212,7 @@ void QXcbDrag::startDrag()
setUseCompositing(current_virtual_desktop->compositingActive());
setScreen(current_virtual_desktop->screens().constFirst()->screen());
+ initiatorWindow = QGuiApplicationPrivate::currentMouseWindow;
QBasicDrag::startDrag();
if (connection()->mouseGrabber() == Q_NULLPTR)
shapedPixmapWindow()->setMouseGrabEnabled(true);
@@ -208,6 +221,7 @@ void QXcbDrag::startDrag()
void QXcbDrag::endDrag()
{
QBasicDrag::endDrag();
+ initiatorWindow.clear();
}
static xcb_translate_coordinates_reply_t *
@@ -821,7 +835,7 @@ void QXcbDrag::handle_xdnd_status(const xcb_client_message_event_t *event)
DEBUG("xdndHandleStatus");
waiting_for_status = false;
// ignore late status messages
- if (event->data.data32[0] && event->data.data32[0] != current_proxy_target)
+ if (event->data.data32[0] && event->data.data32[0] != current_target)
return;
const bool dropPossible = event->data.data32[1];