Screenshot is saved and viewable without the need to interact with Portal window.
This was reproduced on RHEL9-2 with xdg-desktop-portal-1.12.4-1.el9.x86_64. I can also reproduce on RHEL8-8 with xdg-desktop-portal-1.8.1-1.el8.x86_64
On Fedora 38 with xdg-desktop-portal-1.16.0-2.fc38.x86_64 I am unable to reproduce, the screenshot is not viewable until I confirm the dialog and cannot be seen if I do not.
I can capture screenshot via dbus, the Portal window shows but I have no need to interact with it to see the image. Is this intended behavior or am I doing something wrong? I would assume the image would not be accessible before confirming the Portal window and definitely should not be seen if I cancel it. No matter what I click in the Portal application I will get the screenshot.
The reproducer I am using:
#!/usr/bin/env python3
from dasbus.connection import SessionMessageBus
MESSAGE_BUS = SessionMessageBus()
SCREENSHOT_PROXY_OBJECT = MESSAGE_BUS.get_proxy(
service_name="org.freedesktop.portal.Desktop",
object_path="/org/freedesktop/portal/desktop"
)
SCREENSHOT_PROXY_OBJECT.Screenshot("/home/test/Pictures/", {})