From c8c1604e881920cd6130dd642d0cace77dd4cbe5 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 11 Oct 2012 15:29:40 +0200 Subject: Fix drops from external sources. Task-number: QTBUG-26832 Change-Id: Ia1ccce391178e73d26a4f09955bce6c37616384f Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/qxcbdrag.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index cd7237e4b4..1842309b17 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -763,6 +763,8 @@ void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t response.data.data32[3] = 0; // w, h response.data.data32[4] = toXdndAction(qt_response.acceptedAction()); // action + accepted_drop_action = qt_response.acceptedAction(); + if (answerRect.left() < 0) answerRect.setLeft(0); if (answerRect.right() > 4096) @@ -776,8 +778,6 @@ void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t if (answerRect.height() < 0) answerRect.setHeight(0); - response.data.data32[4] = toXdndAction(qt_response.acceptedAction()); - // reset target_time = XCB_CURRENT_TIME; @@ -948,15 +948,14 @@ void QXcbDrag::handleDrop(QWindow *, const xcb_client_message_event_t *event) if (l[2] != 0) target_time = /*X11->userTime =*/ l[2]; - // this could be a same-application drop, just proxied due to - // some XEMBEDding, so try to find the real QMimeData used - // based on the timestamp for this drop. - Qt::DropActions supported_drop_actions(l[4]); + Qt::DropActions supported_drop_actions; QMimeData *dropData = 0; if (currentDrag()) { dropData = currentDrag()->mimeData(); + supported_drop_actions = Qt::DropActions(l[4]); } else { dropData = platformDropData(); + supported_drop_actions = accepted_drop_action; } if (!dropData) -- cgit v1.2.3