flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
23.98k stars 1.52k forks source link

App indicator icon on Gnome 43 does not invoke taking screenshot #2942

Open straurob opened 1 year ago

straurob commented 1 year ago

Flameshot Version

Flameshot v12.1.0 (-) Compiled with Qt 5.15.5 linux: 5.19.14-300.fc37.x86_64 fedora: 37

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

Fedora 37 Beta

Description

When starting flameshot, the "tray icon" is visible and clickable. When, however, clicking on "Take screenshot" the application does not bring up the dialog for taking a screenshot. Bringing up "About" or "Configuration" works fine. Also running flameshot gui from the command-line works successfully.

Steps to reproduce

  1. Start Flameshot.
  2. Click on tray icon.
  3. Click on "Take screenshot"

Screenshots or screen recordings

image

System Information

borgmanJeremy commented 1 year ago

You might want to file this with the Fedora37 Beta. I doubt this is a flameshot bug since it works fine on Arch.

mmahmoudian commented 1 year ago

@straurob would you please try to see if you can run it from terminal (flameshot gui). I want to be sure it is not a duplicate or #2880

uacode commented 1 year ago

[dobs@dobs-workstation ~]$ flameshot gui flameshot: error: Unable to capture screen flameshot: error: Unable to capture screen flameshot: info: Screenshot aborted.

fc37. Gnome 43. Wayland

mmahmoudian commented 1 year ago

@uacode It seems your issue is alost certainly a duplicate of #2880

pled commented 1 year ago

Same issue here using Debian 12 "bookworm" with Gnome 43 latest updates + menu does display nicely.

Versions : OS: Debian GNU/Linux bookworm/sid x86_64 DE : Gnome 43.0 $XDG_SESSION_TYPE : wayland Flameshot 12.1.0-1

Menu display : Capture d’écran du 2022-10-23 17-12-05

Command line output :

$ flameshot gui
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
flameshot: error: Unable to capture screen
flameshot: error: Unable to capture screen
qt.svg: Invalid path data; path truncated.
qt.svg: Invalid path data; path truncated.
flameshot: info: Screenshot aborted.
straurob commented 1 year ago

would you please try to see if you can run it from terminal (flameshot gui). I want to be sure it is not a duplicate or #2880

@mmahmoudian After having updated to the latest dependencies of Fedora 37 Beta, I cannot observe the issue anymore. Both, flameshot gui and the tray icon, allow me to trigger taking a screenshot.

However, I'm unable to save the screenshot but this is a separate issue.

mmahmoudian commented 1 year ago

@xvitaly I believe you are the maintainer of Flameshot on Fedora. Would you please update the dependencies as it seems that the main issue is lack of some packages based on the comments above.

xvitaly commented 1 year ago

Would you please update the dependencies as it seems that the main issue is lack of some packages based on the comments above.

What dependencies?

mmahmoudian commented 1 year ago

@straurob

Would you please elaborate more on the following part if your comment so that @xvitaly does the potential required changes.

After having updated to the latest dependencies of Fedora 37 Beta, I cannot observe the issue anymore.

xvitaly commented 1 year ago

Would you please elaborate more on the following part if your comment so that @xvitaly does the potential required changes.

GNOME bugs doesn't require our attention. They break everything every major release. They don't have a stable API for extensions, so extension developers need some time to port their projects to the new API.

Also, F37 was delayed for 2 more weeks.

straurob commented 1 year ago

Would you please elaborate more on the following part if your comment so that @xvitaly does the potential required changes.

I'd like to but I'm afraid that I cannot tell which dependencies contribute to that. I have added the latest testing repositories from Fedora to my repo list applying regular updates. I would suggest to wait until the official release of Fedora 37 with Gnome 43.

Neo-29 commented 1 year ago

Same here on gnome archlinux 43.2 Can't use capture screen from tray Doesn't work flameshot gui allows me to capture screen. image

screenshot done with second command Is there a way to solve the issue on wayland?

NB : QT_QPA_PLATFORM=wayland is correctly set no result

kodemeister commented 1 year ago

Faced the same issue on Arch, GNOME 43, Wayland, flameshot package installed via pacman. Take Screenshot from tray icon doesn't work if I run flameshot from Activities or from dash-to-dock. I see the following error in the system logs coming from xdg-desktop-portal:

Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog

However, Take Screenshot works fine if I run flameshot either from terminal or from GNOME launcher (Alt+F2).

What worked for me is:

  1. Install flameshot as flatpak instead of Arch package.
  2. Run flameshot, take screenshot and grant permissions to app as outlined here.

After that I'm able to successfully make screenshots regardless of the way I run flameshot.

It's really strange why flatpak version of the flameshot works fine while the regular Arch package does not. Both of them use the same xdg-desktop-portal implementation.

mmahmoudian commented 1 year ago

⚠️⚠️⚠️ I'm not going to waste more time on tracking this issue, at least for now. Gnome has shown to be very unstable and if the comment above does not help you, then perhaps we should either wait for the Gnome API to stabilizes or you should consider a more stable DE!

I have invested hours on this and it is getting outrageous and out of control. me and other devs are feeling the burnout (one example this here)

I keep this thread open, but I will hide all comment unless they are presenting a solution or a way to handle the situation. I believe we don't need more users' comments just to state that Flameshot does not work on Gnome 4X.

Thank you for your understanding. ⚠️⚠️⚠️

vegantom commented 1 year ago

Sorry to bump an old thread but this is what solved it for me, seemingly the same bug: https://github.com/flameshot-org/flameshot/issues/2868#issuecomment-1312470098

What makes these threads a little confusing is this page: https://flameshot.org/docs/guide/troubleshooting/#flameshot-icon-is-visible-in-tray-area-but-when-i-click-on-it-nothing-happens Directs us to make an issue, but @mmahmoudian is indicating the opposite in the last comment here. I wonder if it'd be worth updating the page? Either way, to save people clicking my first link, here is what the solution that worked for me was:

  1. Run flameshot
  2. Open flameshot's settings window(I also maximized the window to lower the chances of loosing focus of that window - probably not needed)
  3. Take a screenshot using flameshot - I clicked the tray icon that came from a gnome extension
  4. Permissions question should appear - grant it
  5. It should now work fine without asking for permissions next time you take a screenshot

This worked for me on gnome44, arch (using official repos for flameshot, with the optional dependencies installed), wayland, and probably not relevant but just in case, nvidia.

RobOT05442309 commented 9 months ago

Just to give a feedback on @vegantom's solution, this WORK for me.

Edit: And better, it doesn't ask anymore for permission of sharing the screen with Flameshot, just select "take a screenshot" from top icon immediately take a new screenshot without an other annoying pop-up before!

Thanks you a lot for your finding, I've spend hour reading issue to check for something that may work and your solution is the only one that actually did the trick.

Works for me on Fedora Gnome 44.5 on Wayland using Flameshot flatpak (haven't test on rpm from repo but might work the same). If anyone managed to get it working the same way, I think it could be really nice to save dev and community time pinning your workaround or something because I don't think much people will look around issue and trying to debug during hours.

Thanks you Flameshot dev for making this amazing piece of software that I almost use everyday before I made the switch to wayland and thanks to @vegantom for this finding!

Rtoax commented 8 months ago

If you use GNOME, may try what i tried in https://github.com/ksnip/ksnip/issues/995

martin-schell commented 7 months ago

Hello everyone, I had the same issue.

System information:

Previous version -> current version

Description

If I entered flameshot gui in the terminal, I was able to take a screenshot with Flameshot. If I entered the Print key as shortcut for flameshot gui, the following error messages occured in the journal

xdg-desktop-por[3852]: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog flameshot[32110]: flameshot: error: Unable to capture screen

Solution

To fix the issue, I created the following script, set the executable bit for the script and set the Print key as the shortcut for /path/to/script/run_flameshot.sh.

  1. Create the following script
#!/usr/bin/env bash                                                             
flameshot gui
  1. Set its executable bit with chmod u+x /path/to/script/run_flameshot.sh
  2. If you want to keep the existing shortcuts for the Gnome Screenshot tool, create a new shortcut for the Script. Otherwise, take one of the existing shortcuts.
  3. If you initially run Flameshot, you have to allow Flameshot to take screenshots. After your agreement, you can use your shortcut.

If I type Print or your shortcut, the script will run and I can take a screenshot with Flameshot.

If you accidentally deny Flameshot authorization, you can reset the authorization with the following command (refer to fedoraproject.org).

dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.DeletePermission string:'screenshot' string:'screenshot' string:''

Then, run Flameshot and allow it to take screenshots.

Casue of Issue: Probably the missing permission in Wayland for third-party-tools to take screenshots.

Additional Information:

Disabling Wayland in /etc/gdm3/custom.conf also worked for me, too. However, after disabling Wayland, I could no longer copy screenshots in Emacs (it uses wl_clipboard). So this was not a workaround for me.

I am happy to use Flameshot and thank the Flameshot team for this great application.