Open m1xmstr opened 10 months ago
I have the same exact behavior after upgrading to Fedora 39 (Gnome 45). It was working fine right before upgrading.
In the terminal, executing flameshot gui
works fine, but calling it from a custom Gnome shortcut, I see a permission error.
Sep 26 17:14:17 brian-fedora xdg-desktop-por[16068]: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
Sep 26 17:14:17 brian-fedora flameshot[82450]: flameshot: error: Unable to capture screen
Sep 26 17:14:17 brian-fedora flameshot[82450]: flameshot: error: Unable to capture screen
Sep 26 17:14:17 brian-fedora flameshot[82450]: flameshot: info: Screenshot aborted.
@brianquirion I found a strange workaround to this problem. If Flameshot is executed under strace, everything works well. It's not pretty, but it's better than nothing)
https://github.com/flameshot-org/flameshot/assets/41896087/dc201e0d-5e26-4d00-99c1-06c3be3e5ac0
@m1xmstr @brianquirion @dmitry-j-mikhin I assume you are are on Wayland? Can you all confirm that?
@mmahmoudian yes, I'm on Wayland
Wayland as well...
Thanks. Lets see what Gnome broke this time around 🙄
Probably related to https://github.com/flameshot-org/flameshot/issues/3326
Probably related to #3326
Yep. Looks like the same.
It's stopped working since upgrading xdg-desktop-portal to 1.17. According to discussion on x-d-p github, apparently previously it was working because of a bug in pre-1.17 which allowed to run flameshot this way and probably because of a bug in flameshot https://github.com/flatpak/xdg-desktop-portal/issues/1070
AFAIU probably x-d-p fixed the bug but it's now flameshot's time to fix it's bug.
Same for me under Wayland on Fedora 38 - "Unable to capture screen"
From the linked xdg-desktop-portal issue, the workaround is here: https://github.com/flatpak/xdg-desktop-portal/issues/1070#issuecomment-1771302632
Giving flameshot QT_QPA_PLATFORM=wayland
env variable works for me.
Giving flameshot
QT_QPA_PLATFORM=wayland
env variable works for me.
I updated every exec
line in /usr/share/applications/org.flameshot.Flameshot.desktop
to:
- Exec=flameshot
+ Exec=env QT_QPA_PLATFORM=wayland flameshot
- Exec=flameshot config
+ Exec=env QT_QPA_PLATFORM=wayland flameshot config
- Exec=flameshot gui --delay 500
+ Exec=env QT_QPA_PLATFORM=wayland flameshot gui --delay 500
- Exec=flameshot launcher
+ Exec=env QT_QPA_PLATFORM=wayland flameshot launcher
Nothing worked, but it does when I run from the terminal.
Same problem, so right now we go on x11 session and waiting for fix for wayland?
Same problem, so right now we go on x11 session and waiting for fix for wayland?
You can try the workaround with setting QT_QPA_PLATFORM=wayland
, that worked for me on wayland.
Perhaps Flameshot hasn't yet been updated to use: https://github.com/flatpak/xdg-desktop-portal/commit/c8274173f7d127f1d7e39e8b5bcaf7f0ee751f48
Can confirm. Fedora 39 here, the gnome shortcut doesn't work anymore. It was fine under Fedora 38. If I run flameshot gui from the terminal, that's working.
flameshot gui
in fedora 39 works fine for me.
I've upgraded to Fedora 39 and I am facing the same issue. the flameshot gui
works well when I run it under the Terminal but not from the keyboard shortcut. Wayland of course
I've upgraded to Fedora 39 and I am facing the same issue. the
flameshot gui
works well when I run it under the Terminal but not from the keyboard shortcut. Wayland of course
Yes, same here. Now I use gnome-screenshot alongside flamshot. I run flameshot occasionally from the terminal when I need to add annotations and arrows, it is faster than gnome-screenshot
+ maoschanz/drawing
.
In my case, Flameshot can only run from the Terminal, it doesn't work from the GUI menu app.
On wayland. Same as above, from CLI it works but gnome shortcut doesn't.
I have the same issue.
My keyboard shortcut stopped working but launching from terminal works fine.
I made a workaround that works just fine.
I made a shell script called flameshot-workaround.sh
#!/bin/bash
flameshot gui
make it executable with chmod +x
made a bin file in /bin
called flameshot-workaround
the bin file contains the path to the script;
#!/bin/bash
~/scripts/sh_utils/flameshot-workaround.sh
Replaced Gnome shortcut to call the new flameshot-workaround
bin,
This should help everyone for a while as the team fixes the issue.
Thank you FlameShot Devs!
Write a script named flameshot.sh, give it execute permissions, and place it in /usr/local/bin:
#!/bin/bash
if [ $# -eq 0 ]; then
flameshot gui
elif [ "$1" == "config" ]; then
flameshot config
elif [ "$1" == "gui" ]; then
flameshot gui --delay 500
elif [ "$1" == "launcher" ]; then
flameshot launcher
else
echo "Unsupported argument"
exit 1
fi
Modify org.flameshot.Flameshot.desktop:
Exec=flameshot.sh
Exec=flameshot.sh gui
Exec=flameshot.sh config
Hello,
Running these commands resolve the bug:
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.SetPermission string:'screenshot' boolean:true string:'screenshot' string:'org.flameshot.Flameshot' array:string:'yes'
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'
Hello,
Running these commands resolve the bug:
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.SetPermission string:'screenshot' boolean:true string:'screenshot' string:'org.flameshot.Flameshot' array:string:'yes'
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'
This worked for me perfectly!
In my case, flameshot works from the terminal, I have a Gnome popup asking for authorizing flameshot to take screenshots permanently, but I have an error when I trigger flameshot gui from a keyboard shortcut
Thanks @Aztek1337 for your workaround
When I executed these two commands:
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.SetPermission string:'screenshot' boolean:true string:'screenshot' string:'org.flameshot.Flameshot' array:string:'yes'
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'
the launch of Flameshot from the shortcut started working properly, but when I added a keyboard shortcut (Ctrl + PrntScr) for flameshot gui, I get "Unable to capture Screen". Through the script (as I wrote earlier) the keyboard shortcut works fine.
I have the same issue.
My keyboard shortcut stopped working but launching from terminal works fine.
I made a workaround that works just fine.
I made a shell script called
flameshot-workaround.sh
#!/bin/bash flameshot gui
make it executable with chmod +x
made a bin file in
/bin
calledflameshot-workaround
the bin file contains the path to the script;#!/bin/bash ~/scripts/sh_utils/flameshot-workaround.sh
Replaced Gnome shortcut to call the new
flameshot-workaround
bin,This should help everyone for a while as the team fixes the issue.
Thank you FlameShot Devs!
Worked for me, thank you!
Crazy this issue is still not resolved...
Gnome 46 is now in BETA and we don't seem to be any closer to a merged solution.
The shell script workaround of:
#!/bin/bash
flameshot gui
is a poor work around in my opinion. Are the following d-bus alterations cross platform / worth baking into the extension:
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.SetPermission string:'screenshot' boolean:true string:'screenshot' string:'org.flameshot.Flameshot' array:string:'yes'
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'
or is it a workaround as well?
Is there a "proper" way to fix this not being discussed? If the d-bus commands are the best way, perhaps someone (or myself) can prepare a merge request.
Same here. Upgrading from Fedora 38 to 39 (GNOME, Wayland) broke flameshot gui
(native version from Fedora repo) when ran through key bind. When doing so, a notification appears:
Flameshot Error Unable to capture screen
Flameshot works when ran through terminal.
Did clean install of Fedora 40 (GNOME, Wayland) and the issue still persists. Someone told me it works on X11.
$ flameshot -v
Flameshot v12.1.0 (-)
Compiled with Qt 5.15.12
Creating a shell script workaround works, but obviously it's less than ideal.
Flameshot Version
12.1.0
Installation Type
Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
Operating System type and version
Fedora 39 Gnome
Description
Installation works fine, open launcher works fine but when you try to capture you get "Unable to capture screen"
Steps to reproduce
No response
Screenshots or screen recordings
Hmmm funny that won't work :P
System Information
Fedora 39 Was working fine on Fedora 38