Skip to content

Linux drag-and-drop failures when the source invalidates the token - #505

Open
sun-jiao wants to merge 2 commits into
MixinNetwork:mainfrom
sun-jiao:main
Open

sun-jiao wants to merge 2 commits into
MixinNetwork:mainfrom
sun-jiao:main

Conversation

@sun-jiao

Copy link
Copy Markdown
Contributor

GTK could end the drop before the portal transfer token was resolved asyncly. And the source could then invalidate the transfer token, causing org.freedesktop.portal.FileTransfer.RetrieveFiles to fail with an Invalid transfer error.

This change makes the plugin manage the drop lifecycle explicitly. For portal file transfers, it now:

keep the drag context alive while resolving the portal transfer token;
call org.freedesktop.portal.FileTransfer.RetrieveFiles to retrieve the file paths;
convert the resolved paths to file URIs and pass them through the existing Linux drop handling path;
call gtk_drag_finish() only after the async portal operation has completed;
fall back to requesting text/uri-list if the portal transfer cannot be resolved.

sun-jiao added a commit to sun-jiao/flut-renamer that referenced this pull request Sep 24, 2026

This branch has not been deployed

No deployments
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