[desktop_drop] Linux: prefer text/uri-list over the portal transfer target - #501
Open
mx1up wants to merge 2 commits into
Open
[desktop_drop] Linux: prefer text/uri-list over the portal transfer target#501mx1up wants to merge 2 commits into
mx1up wants to merge 2 commits into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
problem
GTK matches the first destination target the drag source also offers, and 0.8.1 registered
application/vnd.portal.filetransferahead 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.RetrieveFilesrejects the key withorg.freedesktop.DBus.Error.AccessDenied: Invalid transfer,_resolvePortalFilesreturns 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_receivedalready routestext/uri-listthroughperformOperation_linux.similar to #464