Fix drops from external sources.
Task-number: QTBUG-26832 Change-Id: Ia1ccce391178e73d26a4f09955bce6c37616384f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
dccd784edf
commit
c8c1604e88
@ -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[3] = 0; // w, h
|
||||||
response.data.data32[4] = toXdndAction(qt_response.acceptedAction()); // action
|
response.data.data32[4] = toXdndAction(qt_response.acceptedAction()); // action
|
||||||
|
|
||||||
|
accepted_drop_action = qt_response.acceptedAction();
|
||||||
|
|
||||||
if (answerRect.left() < 0)
|
if (answerRect.left() < 0)
|
||||||
answerRect.setLeft(0);
|
answerRect.setLeft(0);
|
||||||
if (answerRect.right() > 4096)
|
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)
|
if (answerRect.height() < 0)
|
||||||
answerRect.setHeight(0);
|
answerRect.setHeight(0);
|
||||||
|
|
||||||
response.data.data32[4] = toXdndAction(qt_response.acceptedAction());
|
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
target_time = XCB_CURRENT_TIME;
|
target_time = XCB_CURRENT_TIME;
|
||||||
|
|
||||||
@ -948,15 +948,14 @@ void QXcbDrag::handleDrop(QWindow *, const xcb_client_message_event_t *event)
|
|||||||
if (l[2] != 0)
|
if (l[2] != 0)
|
||||||
target_time = /*X11->userTime =*/ l[2];
|
target_time = /*X11->userTime =*/ l[2];
|
||||||
|
|
||||||
// this could be a same-application drop, just proxied due to
|
Qt::DropActions supported_drop_actions;
|
||||||
// some XEMBEDding, so try to find the real QMimeData used
|
|
||||||
// based on the timestamp for this drop.
|
|
||||||
Qt::DropActions supported_drop_actions(l[4]);
|
|
||||||
QMimeData *dropData = 0;
|
QMimeData *dropData = 0;
|
||||||
if (currentDrag()) {
|
if (currentDrag()) {
|
||||||
dropData = currentDrag()->mimeData();
|
dropData = currentDrag()->mimeData();
|
||||||
|
supported_drop_actions = Qt::DropActions(l[4]);
|
||||||
} else {
|
} else {
|
||||||
dropData = platformDropData();
|
dropData = platformDropData();
|
||||||
|
supported_drop_actions = accepted_drop_action;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dropData)
|
if (!dropData)
|
||||||
|
Loading…
Reference in New Issue
Block a user