flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

Confinement issue on Ubuntu Gnome

Open borgmanJeremy opened this issue 6 months ago • 6 comments

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.

borgmanJeremy avatar Jun 18 '25 00:06 borgmanJeremy

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

borgmanJeremy avatar Jun 25 '25 20:06 borgmanJeremy

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

borgmanJeremy avatar Jun 26 '25 01:06 borgmanJeremy

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.

Kyuyrii avatar Jun 29 '25 19:06 Kyuyrii

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.

Kyuyrii avatar Jul 01 '25 02:07 Kyuyrii

A workaround for the flatpak is to manually grant permission with:

flatpak permission-set screenshot screenshot org.flameshot.Flameshot yes

Good 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"

GarThor avatar Nov 24 '25 02:11 GarThor

For those installing from snap, use

flatpak permission-set screenshot screenshot snap.flameshot yes

lnking81 avatar Dec 07 '25 12:12 lnking81