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

Provide a mock gnome-screenshot command to take screenshots using the xdg-desktop-portal DBus API #111

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

jonasbb
Copy link

@jonasbb jonasbb commented Jan 11, 2025

The app does not use the xdg-desktop-portal API for screenshots yet. It can fall back to using the gnome-screenshot command. That is not provided by the runtime.

Instead this commit adds a mock gnome-screenshot command that uses the portal API for taking screenshots and saves them to a file. This makes loading QR codes work from within a flatpak.

#78
Yubico/yubioath-flutter#1010

… xdg-desktop-portal DBus API

The app does not use the xdg-desktop-portal API for screenshots yet. It
can fall back to using the gnome-screenshot command. That is not
provided by the runtime.

Instead this commit adds a mock gnome-screenshot command that uses the
portal API for taking screenshots and saves them to a file. This makes
loading QR codes work from within a flatpak.

flathub#78
Yubico/yubioath-flutter#1010
@flathubbot
Copy link
Contributor

Started test build 173713

@flathubbot
Copy link
Contributor

Build 173713 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/156842/com.yubico.yubioath.flatpakref

@jonasbb jonasbb marked this pull request as ready for review January 11, 2025 21:56
@jonasbb
Copy link
Author

jonasbb commented Jan 11, 2025

I tested the above test build and the screenshot capability works.

@Erick555
Copy link
Contributor

is it supposed to work everywhere or only on gnome?

@jonasbb
Copy link
Author

jonasbb commented Jan 12, 2025

This should work on any system where the portal offers the screenshot capability. The added Python file here just uses DBus to speak to org.freedesktop.portal.

This is the snippet in the Yubioath app that calls into gnome-screenshot. It is just gated by a linux platform check, but otherwise is agnostic of the environment.
https://github.com/Yubico/yubioath-flutter/blob/5fd90578535ae9cef006339691e1dc3a5b8b7f65/helper/helper/qr.py#L36-L65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants