in reply to Krafting

you can use the background portal through libportal: libportal.org/method.Portal.re…

Or you can call the DBus method directly: flatpak.github.io/xdg-desktop-…

in reply to Emmanuele Bassi

@ebassi Welp, I got it almost working. I get an error when trying to compile the flatpak thogh...

"ValueError: Namespace Xdp not available"

I import Xdp in python using

gi.require_version('Xdp', '1.0')
from gi.repository import Xdp

It works by running the script with python script.py but not in the flatpak...

Doesn't the org.gnome.Sdk/47 comes with Xdp ?

in reply to Krafting

no, libportal is not currently in the run time, I'm afraid; you need to build it inside your manifest, like this: github.com/flathub/re.sonny.Wo…

It's enough to build the library: it comes with its own introspection data that can be loaded by pygobject.

in reply to Krafting

it's a complicated question; libportal is not a stable API, so shipping it in the run time could cause issues when updating the dependency in applications: gitlab.gnome.org/GNOME/gnome-b…