From 32ad01026f74e92374b32e94d4b99904eaf5d22f Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 13 Nov 2023 17:38:38 +0100 Subject: QWaylandMimeData: Skip "DELETE" format This is presumably a left-over from XDND: https://freedesktop.org/wiki/Specifications/XDND/ > In general, XdndActionMove is implemented by first requesting the data > and then the special target DELETE defined in the X Selection > protocol. [...] DELETE should be sent before XdndFinished. Firefox sends this during dragging of files but trying to fetch it will fail, leading to a timeout and potential freeze. Pick-to: 6.5 Change-Id: Ic30f5cb23587c63d54859c5eaebb3a054a25ac69 Reviewed-by: Liang Qi (cherry picked from commit c28b35521943646f5de5fbc44888f66a01e7a849) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit e5fe8e08ec8797295d970c1b1db2fa33f53d7aa2) --- src/client/qwaylanddataoffer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index 095df47e4..f1fbde7c6 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -147,8 +147,11 @@ QWaylandMimeData::~QWaylandMimeData() void QWaylandMimeData::appendFormat(const QString &mimeType) { - m_types << mimeType; - m_data.remove(mimeType); // Clear previous contents + // "DELETE" is a potential leftover from XdndActionMode sent by e.g. Firefox, ignore it. + if (mimeType != QLatin1String("DELETE")) { + m_types << mimeType; + m_data.remove(mimeType); // Clear previous contents + } } bool QWaylandMimeData::hasFormat_sys(const QString &mimeType) const -- cgit v1.2.3