Skip to content

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

Open
mx1up wants to merge 3 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 3 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new changelog section conflicts with the repository’s maintainer-owned release metadata policy.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Prioritizes Linux URI drag targets to avoid invalid portal transfers from KDE/Deepin file managers.

Changes:

  • Registers URI targets before portal and STRING fallbacks.
  • Documents the Linux drag-target fix.
File summaries
File Description
packages/desktop_drop/linux/desktop_drop_plugin.cc Reorders GTK drop targets.
packages/desktop_drop/CHANGELOG.md Adds an unreleased fix entry.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/desktop_drop/CHANGELOG.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants