xdg-desktop-portal
xdg-desktop-portal copied to clipboard
Directories mounted to flatpak sandbox via --persist can't be opened in other apps
If a flatpak app has some --persist dirs, files under these dirs can't be passed through/opened in other apps.
Given an app has --persist=.some-persisted-dir, running xdg-open ~/.some-persisted-dir does nothing.
Example: flatpak run --command=xdg-open com.valvesoftware.Steam ~/.steam
This is vaguely similar to #590, but harder, because we cannot tell from just the realpath() which path is right.
One possible implementation would be:
- Get the path from
/proc/self/fd/*as usual - If it is in the home directory, first try probing the corresponding file in the per-app persist directory; if it's the same file (device/inode numbers match), then this is it.
- Otherwise fall back to using the unedited path.
This will likely require some refactoring.