Skip to content
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

Requirements to access org.freedesktop.portal.Screenshot? #950

Open
dynobo opened this issue Jan 15, 2023 · 4 comments
Open

Requirements to access org.freedesktop.portal.Screenshot? #950

dynobo opened this issue Jan 15, 2023 · 4 comments
Labels
needs discussion Needs discussion on how to implement or fix the corresponding task portal: screenshot Screenshot portal question

Comments

@dynobo
Copy link

dynobo commented Jan 15, 2023

Dear flatpak Team,

I'm developing a small screenshot utility called NormCap and was struggling to get it to work with the latest Gnome release from within a flatpak. After some investigation, it seems to me like a flatpak-app now needs to fulfill two requirements when requesting a screenshot, at least for the first time:

  1. At the time of sending the request via DBUS, the app needs to have an (active?) window.
  2. interactive needs to be True.

If one of the prerequisites is missing, the dialog asking to grant the app permission to access the screenshot feature will not appear → therefore the app doesn't get the required permissions → with the result that the app never receives a response, neither with the URI to the image, nor an error.

(Sidenote: After the requirements were met once, and the permissions got granted, I'm successfully able to receive the screenshot URI without any visible window and with interactive set to False.)

Now my questions/suggestions:

  1. Is this intended behavior?
  2. If yes, might it be a good idea to add these details to the documentation?
  3. The requirement (1) of having an active window when requesting the screenshot for the very first time is quite cumbersome for apps like mine, that use the screenshot as prerequisite for creating the initial window. I currently try to solve this, by showing a placeholder window first, but this isn't good UX. Is there a technical reason for that requirement? If not, I'd propose to drop it. :-)

Thanks for your great work! 👍

@Mikenux
Copy link

Mikenux commented Sep 1, 2023

See from flameshot-org/flameshot#3213 (comment)

@swick also opened #1093

@GeorgesStavracas GeorgesStavracas moved this to Needs Triage in Triage Oct 2, 2023
@GeorgesStavracas GeorgesStavracas added question needs discussion Needs discussion on how to implement or fix the corresponding task portal: screenshot Screenshot portal labels Oct 5, 2023
@GeorgesStavracas
Copy link
Member

It's unclear if what needs to happen is documenting the current behaviour, or changing the current behavior.

@GeorgesStavracas GeorgesStavracas moved this from Needs Triage to Triaged in Triage Oct 5, 2023
@dynobo
Copy link
Author

dynobo commented Oct 5, 2023

It's unclear if what needs to happen is documenting the current behavior, or changing the current behavior.

Exactly.

For what it's worth: for applications like mine or flameshot, etc., it would be beneficial to the UX to not require an open active window.

Or at least to offer a way to query if the permission is set or not or return a "permission denied" error or something. Currently, I'm doing the DBus request and wait an arbitrary time (e.g. 15s) to see if I get a response or not, because I don't even receive an error in case of missing permissions. That means the user has to wait that time span (which has to be quite long, as screenshots on 3x 4K displays can take ~15s over portal), before I can present a "open active window" as workaround and do an interactive request again.

@swick
Copy link
Collaborator

swick commented Oct 6, 2023

There are a few cases with portals now where it might be good to have some way to let clients see the state of the permission and let the client open the system settings to let the user change a specific permission.

Obviously it's not clear if we want a feature like that in general. We tried hard so far to avoid this kind of explicit permission granting system and instead grant permissions implicitly. Probably something we need to discuss at a higher level first before coming back to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Needs discussion on how to implement or fix the corresponding task portal: screenshot Screenshot portal question
Projects
No open projects
Status: Triaged
Development

No branches or pull requests

4 participants