You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The application needs an ability to scan QR code from screen, but arbitrary reading from screen is not supported on Wayland for security reasons. But an ability to get screen content when needed is needed sometimes. So there is an API for that. There is a generic API for permission-based access granting on Linux. It's called XDG Desktop Portals. There is a portal for taking screenshot.
It's already used in some apps for the same thing. For example, Authenticator, an application for generating two-factor codes, uses the portal to scan QR code.
There are some advantages of this way to scan QRs from the screen:
Universality. The portal will work on every desktop environment that support it. Your current hack using GNOME Screenshot and Spectacle requires GNOME Screenshot and Spectacle to be installed and also only works on GNOME and KDE, but the portal works on GNOME, KDE, Elementary, wlroots-based WMs and every desktop environment that supports or will support the portal.
Sandboxability. The portal works well with sandboxing systems like Flatpak and Snap, so the application will be able to work without unrestricted access to the host system.
Consistency. You won't need to use different parts of code for different Linux desktop environments since the portal API is unified.
Availability. GNOME Screenshot and Spectacle can be or not bet installed on the machine. But XDG Desktop Portals is very common and standard thing that is usually installed on every Linux computer.
Long-term support: Your current hack with GNOME Screenshot and Spectacle supposes that these tools won't change their CLI and behavior. But they can, since they're not designed as any kind of public API. The portal API is a public API that is expected to be stable and supported since applications are expected to use it.
The text was updated successfully, but these errors were encountered:
Solving this issue would get the QR code screenshot feature working for Wayland systems.
Adding the following error message from Sway + Wayland system for SEO visibility:
11:46:02.007 [helper] ERROR: 11:46:02.007 [helper] ERROR: (gnome-screenshot:1642482): Handy-WARNING **: 11:46:02.007: Using GtkSettings:gtk-application-prefer-dark-theme together with HdyStyleManager is unsupported. Please use HdyStyleManager:color-scheme instead.11:46:02.149 [helper] ERROR: 11:46:02.149 [helper] ERROR: ** (gnome-screenshot:1642482): WARNING **: 11:46:02.149: Unable to use GNOME Shell's builtin screenshot interface: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable11:46:02.149 [helper] ERROR: 11:46:02.149 [helper] ERROR: ** (gnome-screenshot:1642482): CRITICAL **: 11:46:02.149: Unable to capture a screenshot of any window[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RpcResponse.error(status: invalid-command, message: Invalid parameters: Unable to capture screenshot, body: {})
The application needs an ability to scan QR code from screen, but arbitrary reading from screen is not supported on Wayland for security reasons. But an ability to get screen content when needed is needed sometimes. So there is an API for that. There is a generic API for permission-based access granting on Linux. It's called XDG Desktop Portals. There is a portal for taking screenshot.
It's already used in some apps for the same thing. For example, Authenticator, an application for generating two-factor codes, uses the portal to scan QR code.
There are some advantages of this way to scan QRs from the screen:
The text was updated successfully, but these errors were encountered: