Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sandbox.h File Reference

Inkscape::IO::Sandbox. More...

Go to the source code of this file.

Namespaces

namespace  Inkscape
 Helper class to stream background task notifications as a series of messages.
 
namespace  Inkscape::IO
 Low-level IO code.
 
namespace  Inkscape::IO::Sandbox
 

Functions

bool Inkscape::IO::Sandbox::filesystem_is_sandboxed ()
 Query if the filesystem is "sandboxed", e.g., by using xdg-portal in flatpak/snap.
 
Glib::ustring Inkscape::IO::Sandbox::filesystem_get_display_path (std::optional< Glib::RefPtr< Gio::File const > > path, Glib::ustring placeholder_if_empty="")
 Translate raw filesystem path to a path suitable for display.
 

Detailed Description

Inkscape::IO::Sandbox.

Utility functions for running Inkscape inside a "sandboxed" filesystem. (on Linux: xdg-portal with snap or flatpak).

Background: To isolate different applications against each other, some newer packaging formats do not allow Inkscape direct access to the user home directory or other paths. Instead, Inkscape can only access special "magic paths" returned by the file-choose dialog. This brings some issues:

  1. The file chooser doesn't always return the true path on the host filesystem, but some replacement, e.g. /run/user/1000/doc/fe812a2/Foldername instead of /home/user/Documents/path/to/my/Foldername. We can access the file via the first path, but want to show the second one to the user.
  2. If we have access to one file "/path/a.svg", we can't just access other files in the same folder. Automatically suggesting filenames, e.g. for export, is not possible anymore. Similarly, editing paths in a text entry widget is not possible anymore.

Copyright (C) 2024 Authors Released under GNU GPL v2+, read the file 'COPYING' for more information.

Definition in file sandbox.h.