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.
feat: expose raw drag text in DropDoneDetails for portal integration #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat: expose raw drag text in DropDoneDetails for portal integration #492
Changes from all commits
e1a8f7efadfce424d39c460b861b90dd9a0c1f039b2754024ad3dbb52380a90e48edb20aa10d530ad218File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One GTK 3 detail changes the diagnosis here: since GTK 3.24.37,
gtk_drag_dest_add_uri_targets()already adds bothapplication/vnd.portal.filetransferand the legacyapplication/vnd.portal.fileswhen the FileTransfer portal is available. Therefore the portal payload can reach this callback on current GTK without another explicit target entry.There is still a negotiation problem worth addressing.
gtk_drag_dest_find_target()selects the first destination target also offered by the source, while this plugin registersSTRINGfirst andgtk_target_list_add_uri_targets()appendstext/uri-listbefore the portal targets. If a source offers both URI and portal representations, the inaccessible URI representation may still win. The native layer should prefer the portal target and pass the selected MIME type alongside its payload so Dart does not infer the type from the text.The tests should also use the payloads GTK can actually deliver: either a URI list or a key-only portal payload. A combined
file://...\nportal-keypayload is not produced by MIME negotiation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed review @boyan01,pushed fixes for all of it:
also went one step further: performOperation_portal resolves the key through org.freedesktop.portal.FileTransfer.RetrieveFiles and emits the document portal paths (/run/user/$UID/doc/...) as regular DropItemFiles.
reason: since the portal target wins negotiation now, old apps that don't know about rawText would get an empty file list where they used to at least get paths. resolving in the plugin keeps files meaning "openable paths" so nobody has to change their code, and doc paths are readable both inside sandboxes (per-app grant) and outside.
rawText still has the key if an app wants it, and if RetrieveFiles fails the event just fires with an empty list. adds dbus as a pure dart dep — happy to move this into native GDBus if you'd rather keep dart deps out.
Uh oh!
There was an error while loading. Please reload this page.