Confinement issue on Ubuntu Gnome
I am opening this to track the upstream post I made here: https://forum.snapcraft.io/t/screenshots-on-gnome-in-snap/47452
The issue is the snap build does not capture screenshots on gnome because gnome returns an error that says "Only the focused application is allowed to show a system access dialog"
However this happens even using the launcher which is a focused application window. It also does not happen when building from source.
Changed title to reflect the post on the snap forums.
This is also an issue with flatpak on ubuntu gnome, but not flatpak on arch
A workaround for the flatpak is to manually grant permission with:
flatpak permission-set screenshot screenshot org.flameshot.Flameshot yes
Good info here: https://github.com/NixOS/nixpkgs/issues/351680
I tested the Snap version on Ubuntu 24.04 and Fedora 42, both on Gnome, and no window appears asking if I want to allow Flameshot to take screenshots.
In the terminal, this error appears
(flameshot:15206): GLib-GIO-WARNING **: 16:37:21.766: GDBus.Error:org.freedesktop.portal.Error.NotAllowed: This call is not available inside the sandbox
When I tested it in KDE, it worked without any problems, as well as in Budgie using Labwc.
So I'm really confused about it not working specifically in Gnome.
Edit: I just installed Fedora Cosmic Spin, Flameshot Snap also worked fine on it.
I edited snapcraft.yaml to remove the slot information, installed it and tested it.
It worked fine in KDE with Wayland, as well as in Budgie with Labwc.
So now I'm confused about whether the dbus-flameshot slot is doing anything.
A workaround for the flatpak is to manually grant permission with:
flatpak permission-set screenshot screenshot org.flameshot.Flameshot yesGood info here: NixOS/nixpkgs#351680
This solution seems to work for me, however the flatpack version seems to only want to capture my center (main) monitor, and doesn't see the ones on the left/right...
I'm not sure if there's a setting for this somewhere, or if maybe there's a bug, because this wasn't the default behavior in the "apt" version...
Edit: I found the solution in this post: https://github.com/flameshot-org/flameshot/issues/3365#issuecomment-3236622227.
TL;DR: set the shortcut to sh -c -- "QT_QPA_PLATFORM=wayland flameshot gui"
For those installing from snap, use
flatpak permission-set screenshot screenshot snap.flameshot yes