-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
directory tree portal #200
Comments
This is not something that the document portal lets us do (export a tree). |
|
A use case for this is having VLC being able to open a DVD directory. Without, I have to copy the DVD directory to my homedir |
I also have a use case that would benefit from a directory portal. My application can export animations, either as video files or as individual frames. When exporting frames, it's not practical to prompt the user for each individual frame, so being able to open a directory is essential. In this particular use case, subdirectory access is not necessary. Applications like Darktable would also benefit from being able to open directories, both for browsing images and for batch exporting processed photos. |
If we're gathering use cases, GNOME Games needs this to be able to support DOS games without full file system access. Those games expect to be able to work with surrounding files, e.g. for reading/writing config and saves. |
It is known hundreds of applications can use this. Lets keep this issue for details on how to implement it. |
What's the situation here. Is there a clear path forward? Showing a GUI to add a filesystem override would be easy but requires an app restart to become visible which is not nice at all. More ideas? |
Portal API support for this landed in xdg-desktop-portal 1.5.3 and xdg-desktop-portal-gtk 1.5.1. Not sure about the KDE portal. Applications can use the new API directly or use libportal to access it (assuming people have the portal versions above installed), but no transparent support has landed in GTK or Qt as of yet. |
Do you mean the SaveFiles method on the document portal? It's the only thing I could find which remotely has anything to do with this issue but it certainly isn't a complete solution to it. |
Oh, yeah I see how that's probably not helpful here. Apologies for the noise. |
Alright, I remembered reading something about a new kernel interface for mounting. https://lwn.net/Articles/759499/ This might be suitable for adding new bind mounts in a running container. First I thought it's possible to create a bind mount using
but apparently that doesn't work ("Block device required"; maybe it's possible and I'm just doing something wrong). I'd really appreciate if someone who knows more about this would chime in. |
Had some more time to test and… host:
sandbox:
This actually works and creates a bind mount from the host's host_directory to the running container's sandbox_directory. It however requires mount caps on both the host and the container. |
In flatpak we would like to be able to make a host subtree visible to some bwrap'ed processes some time after they have already been started (flatpak/xdg-desktop-portal#200). This patch introduces the '--live-mount-fd FD' option. The process calling bwrap can pass a FD this way and write pairs of directories to it which will be interpreted as source and destionation of a bind mount operation. To make this work in bwrap we make /newroot a shared mount and clone off into a new mount namespace for what eventually becomes the container, make /newroot a slave mount in this new mount namespace and continue on normally with unmounting /oldroot and pivioting to /newroot. The original process now still has /oldroot and /newroot and changes in /newroot propagate to the container's mount namespace.
The mount caps are making the previous approach basically useless but I've found a new way using slave mounts which is looking promising (containers/bubblewrap#356). |
@swick are you aware of recent work? https://github.com/alexlarsson/xdg-desktop-portal/commits/new-fuse-backend |
No, I wasn't. That's unfortunate timing. |
This GTK change (and related changes in xdg-desktop-portal and xdg-desktop-portal-gtk) should allow selecting directories for things like music libraries, or output directory if an application is expected to output everything to a single directory. The bug was fixed in c616b49 (and further fixed still in some opened MRs). We're still however missing a UI that would make it clear that opening a file, eg. a project file, would also give access to the rest of the files in that same directory. I've moved the conversation to #463 |
file chooser portal for selecting a directory and its contents + subdirectories for RW
The text was updated successfully, but these errors were encountered: