Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
straurob opened this issue Oct 8, 2022 · 20 comments
Open

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

straurob opened this issue Oct 8, 2022 · 20 comments
Labels
Unconfirmed Bug The bug is not confirmed by anyone else. Upstream There's a problem with upstream code. Waiting For Info Addressing the issue or merging the PR is halted and we are waiting for more info to be provided. Won't Fix Not gonna happen!

Comments

@straurob
Copy link

straurob commented Oct 8, 2022

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

@straurob straurob added the Unconfirmed Bug The bug is not confirmed by anyone else. label Oct 8, 2022
@borgmanJeremy
Copy link
Contributor

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

@mmahmoudian
Copy link
Member

mmahmoudian commented Oct 13, 2022

@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

@mmahmoudian mmahmoudian added the Waiting For Info Addressing the issue or merging the PR is halted and we are waiting for more info to be provided. label Oct 13, 2022
@uacode
Copy link

uacode commented Oct 18, 2022

[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
Copy link
Member

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

@pled
Copy link

pled commented Oct 23, 2022

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
Copy link
Author

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
Copy link
Member

@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
Copy link
Contributor

xvitaly commented Oct 31, 2022

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
Copy link
Member

@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
Copy link
Contributor

xvitaly commented Oct 31, 2022

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
Copy link
Author

straurob commented Nov 1, 2022

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
Copy link

Neo-29 commented Dec 11, 2022

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
Copy link

kodemeister commented Jan 25, 2023

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 mmahmoudian added Won't Fix Not gonna happen! Upstream There's a problem with upstream code. labels Jan 25, 2023
@mmahmoudian
Copy link
Member

mmahmoudian commented Jan 25, 2023

⚠️⚠️⚠️
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
Copy link

vegantom commented May 15, 2023

Sorry to bump an old thread but this is what solved it for me, seemingly the same bug:
#2868 (comment)

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
Copy link

RobOT05442309 commented Sep 20, 2023

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

This comment has been minimized.

@martin-schell
Copy link

martin-schell commented Nov 25, 2023

Hello everyone, I had the same issue.

System information:

Previous version -> current version

  • Ubuntu 23.10 -> Ubuntu 24.04
  • Gnome 45 -> Gnome 46
  • Linux 6.5.0.13 -> 6.8.0.31

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.

@felipsmartins
Copy link

felipsmartins commented Aug 30, 2024

The hack which worked for me.
Consider the following AppImage installation under Debian12+Gnome+Wayland:

# no need to be complicated like this, take the commands work for you.
FLAMESHOT_TEMPDIR=/tmp/flameshot
FLAMESHOT_RELEASE_URL="https://github.com/flameshot-org/flameshot/releases/download/v12.1.0/Flameshot-12.1.0.x86_64.AppImage"

mkdir $FLAMESHOT_TEMPDIR -p && cd $FLAMESHOT_TEMPDIR
curl -L "$FLAMESHOT_RELEASE_URL" -o flameshot.AppImage && chmod a+x ./flameshot.AppImage
sudo cp -v ./flameshot.AppImage /usr/local/bin && sudo ln -svf /usr/local/bin/flameshot.AppImage /usr/local/bin/flameshot
# install desktop entry
./flameshot.AppImage --appimage-extract
sudo cp -v ./squashfs-root/org.flameshot.Flameshot.desktop /usr/local/share/applications
# or: xdg-desktop-menu install --novendor ./squashfs-root/org.flameshot.Flameshot.desktop
sudo cp -v ./squashfs-root/org.flameshot.Flameshot.png /usr/share/pixmaps

So:
Edit desktop entry/file and change the line from Terminal=false to Terminal=true.

Now open from menu and Take a Screenshot. And yes, it'll open a term too, but now the tool works.


side note: maybe it could work with .deb and flatpak package, but I don't have tested yet.

@ne-bknn
Copy link

ne-bknn commented Oct 31, 2024

Hey! I stumbled upon this same issue and discussed solutions did not work. I wanted to launch flameshot gui on PrtSc, set up shortcut in gnome settings, but it did not work on wayland. Shortcut payload is /usr/bin/bash -c 'flameshot gui'. Launching flameshot gui from my go-to terminal - alacritty - did not work either; but it worked on gnome-terminal, kgx, warp. Somewhere in the logs I found that bash was the binary initiating the screenshot and it was not listed as permitted in portal store. There is no bash in permission store:

$ 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'
   array [
      dict entry(
         dev.warp.Warp         array [
            yes         ]
      )
      dict entry(
         org.flameshot.Flameshot         array [
            yes         ]
      )
   ]
   variant       byte 0

And it cannot be added via happy path - it is not considered an active windows by portals/gnome, so no dialog.

But we can add it manually:

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:'bash' array:string:"yes"

And now my shortcut works! Yay! Just a three to four hours of grepping through dbus logs and reading github issues/forum posts to make screenshoting work. Thanks, GNOME!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unconfirmed Bug The bug is not confirmed by anyone else. Upstream There's a problem with upstream code. Waiting For Info Addressing the issue or merging the PR is halted and we are waiting for more info to be provided. Won't Fix Not gonna happen!
Projects
None yet
Development

No branches or pull requests