diff options
author | Kai Uwe Broulik <kde@privat.broulik.de> | 2023-11-13 17:38:38 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-12-20 17:00:28 +0000 |
commit | e5fe8e08ec8797295d970c1b1db2fa33f53d7aa2 (patch) | |
tree | 2cc21855817f2c58f6edd8bf3b2f32e6565ce71c | |
parent | 3ef299ce03c4ef0ee2b37f85b35f19985da782f5 (diff) |
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.6 6.5
Change-Id: Ic30f5cb23587c63d54859c5eaebb3a054a25ac69
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit c28b35521943646f5de5fbc44888f66a01e7a849)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/client/qwaylanddataoffer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index c2fc9f095..94cd249fa 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -149,8 +149,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 |