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-21 00:03:10 +0000 |
commit | 32ad01026f74e92374b32e94d4b99904eaf5d22f (patch) | |
tree | 8a0c42d41fc2dff242014c30c7b9d1ba923ed61a | |
parent | 929c2f8170fd0cf399431448ae8a51bfe5bda925 (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.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>
(cherry picked from commit e5fe8e08ec8797295d970c1b1db2fa33f53d7aa2)
-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 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 |