Skip to content

[desktop_drop] Linux: prefer text/uri-list over the portal transfer target - #501

Open
mx1up wants to merge 2 commits into
MixinNetwork:mainfrom
mx1up:fix/linux-prefer-uri-targets
Open

[desktop_drop] Linux: prefer text/uri-list over the portal transfer target#501
mx1up wants to merge 2 commits into
MixinNetwork:mainfrom
mx1up:fix/linux-prefer-uri-targets

Conversation

@mx1up

@mx1up mx1up commented Sep 5, 2026

Copy link
Copy Markdown

problem

GTK matches the first destination target the drag source also offers, and 0.8.1 registered application/vnd.portal.filetransfer ahead of the URI targets. KDE (Dolphin) and Deepin (dde-fileManager) advertise that portal target on ordinary X11 drags too, not just from sandboxed sources. When it is chosen, org.freedesktop.portal.FileTransfer.RetrieveFiles rejects the key with org.freedesktop.DBus.Error.AccessDenied: Invalid transfer, _resolvePortalFiles returns an empty list, and the drop is silently lost.

solution

Register the URI targets first and demote the portal key and the bare STRING target to fallbacks, so the portal path is taken only when the source offers nothing better (a genuine sandboxed peer). No Dart change needed: on_drag_data_received already routes text/uri-list through performOperation_linux.

similar to #464

mx1up and others added 2 commits September 5, 2026 22:14
…arget

GTK matches the first destination target the drag source also offers, and
0.8.1 registered `application/vnd.portal.filetransfer` ahead of the URI
targets. KDE (Dolphin) and Deepin (dde-fileManager) advertise that portal
target on ordinary X11 drags too, not just from sandboxed sources. When it
is chosen, `org.freedesktop.portal.FileTransfer.RetrieveFiles` rejects the
key with `org.freedesktop.DBus.Error.AccessDenied: Invalid transfer`,
`_resolvePortalFiles` returns an empty list, and the drop is silently lost.

Register the URI targets first and demote the portal key and the bare
STRING target to fallbacks, so the portal path is taken only when the
source offers nothing better (a genuine sandboxed peer). No Dart change
needed: `on_drag_data_received` already routes `text/uri-list` through
`performOperation_linux`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqCpJWAkdfQzBF85aZe8EZ
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqCpJWAkdfQzBF85aZe8EZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant