xdg-desktop-portal icon indicating copy to clipboard operation
xdg-desktop-portal copied to clipboard

Directories mounted to flatpak sandbox via --persist can't be opened in other apps

Open gasinvein opened this issue 4 years ago • 1 comments

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

gasinvein avatar Jun 11 '21 15:06 gasinvein

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.

smcv avatar Jun 11 '21 15:06 smcv