Drag and drop into the Flatpak: handle application/vnd.portal.filetransfer
- Lingua principale
- Rust
- Stelle
- 1
- Fork
- 0
- Merge medio
- 1g 15h
- PR unite (30g)
- 4
Descrizione
crates/app/src/dnd.rs reads `text/uri-list` only, and says in its header that it skips `application/vnd.portal.filetransfer` deliberately because "nothing about this app is sandboxed yet". That sentence expires the day the Flatpak ships (docs/DISTRIBUTION.md 3.7).
A `text/uri-list` drop carries a host `file://` path. Outside a sandbox that path is readable; inside one, with no `--filesystem=` grant, it is `ENOENT`. So a drag onto the Flatpak window fails, while the file chooser and a double click both work (both go through portals).
Two things to know before doing the work:
1. **It does not help against cosmic-files.** The FileTransfer portal needs both sides: the source starts a transfer and offers the mime, the target retrieves by key. cosmic-files as a drag source advertises exactly `text/plain`, `text/plain;charset=utf-8`, `UTF8_STRING`, `text/uri-list` and `x-special/gnome-copied-files` (src/clipboard.rs). It never offers filetransfer. GTK4 apps like Nautilus do, so handling it fixes drops from those and nothing else today.
2. **libcosmic already supports it, opt-in**, through `on_file_transfer` on the drop destination, so the change is small: add the mime to the accepted set and exchange the key over D-Bus for paths.
The alternative is a permission: `--filesystem=xdg-videos:ro` makes host paths from the videos folder readable and is what Clapper takes and the Flathub linter allows. Rejected in the manifest as it stands, because it is a permanent grant bought to work around one launcher's missing feature.
Until one of the two lands, the honest status is: drag and drop does not work in the Flatpak, and the ground-installed build is unaffected.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.