From 8a699ef1877e28927fc7227742d254deed69d9e9 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 24 May 2021 14:06:57 +0000 Subject: [PATCH] [xwl] Notify wayland that our data offer is accepted kwayland-server was updated to follow the result of whether the data offer was accepted before calling drop. Our bridge was not updated. We don't have enough data to know which mimeType the XWayland client actually has accepted, as that doesn't exist at an X11 level, but it doesn't have a big actual impact. Despite which mime type gets accepted any mimetype can be retrieved in the drop event. Tested against "dropsite" from QtBase widget examples forced into xcb mode using dolphin as a source. BUG: 437406 --- src/xwl/drag_wl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xwl/drag_wl.cpp b/src/xwl/drag_wl.cpp index e928a261d8..6b22e09a2b 100644 --- a/src/xwl/drag_wl.cpp +++ b/src/xwl/drag_wl.cpp @@ -158,6 +158,10 @@ bool Xvisit::handleStatus(xcb_client_message_event_t *event) m_accepts = data->data32[1] & 1; xcb_atom_t actionAtom = data->data32[4]; + auto drag = m_drag->dataSourceIface(); + if (drag && !drag->mimeTypes().isEmpty()) { + drag->accept(m_accepts ? drag->mimeTypes().constFirst() : QString()); + } // TODO: we could optimize via rectangle in data32[2] and data32[3] // position round trip finished