flameshot-org / flameshot

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

flamshot 12.1.0 using wayland on fedora 40 randomly gives "flameshot: error: Unable to capture screen" #3664

Open anilv4 opened 1 month ago

anilv4 commented 1 month ago

Flameshot Version

$ flameshot --version Flameshot v12.1.0 (-) Compiled with Qt 5.15.12

Installation Type

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

Operating System type and version

Fedora 40

Description

flameshot errors out saying, "flameshot: error: Unable to capture screen". This happens randomly. Restarting flameshot will resolve the issue. By that time, the screen i want to take screenshot may move to another presentation. Its random and annoying.

Steps to reproduce

  1. start flameshot.
  2. it must be running in the bg for some hours and idle.
  3. suddenly when you want to take a screenshot and click on the flameshot icon in systemtray > take screenshot
  4. it errors out, "flameshot: error: Unable to capture screen"
  5. quit and restart flameshot, the issue will resolve itself.
  6. by that time, the presentation will move to another screen and you lost an important capture.

Screenshots or screen recordings

journalctl logs captured at the time of the issue.

Jul 08 11:01:34 fedora systemd[5881]: Started app-gnome-Flameshot-216474.scope - Application launched by gnome-session-binary. Jul 08 16:27:22 fedora flameshot[216474]: "Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”" Jul 08 16:39:46 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 16:39:46 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 16:39:50 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 16:39:50 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 16:39:56 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 16:39:56 fedora flameshot[216474]: QPixmap::scaled: Pixmap is a null pixmap Jul 08 16:39:56 fedora flameshot[216474]: QPixmap::scaled: Pixmap is a null pixmap Jul 08 16:40:00 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 16:40:00 fedora Flameshot.desktop[216474]: flameshot: error: Unable to capture screen Jul 08 17:32:06 fedora systemd[5881]: app-gnome-Flameshot-216474.scope: Consumed 2.338s CPU time.

System Information

$ flameshot --version
Flameshot v12.1.0 (-)
Compiled with Qt 5.15.12
$ inxi --width 80 --system --graphics
System:
  Host: fedora Kernel: 6.9.7-200.fc40.x86_64 arch: x86_64 bits: 64
  Desktop: GNOME v: 46.3.1 Distro: Fedora Linux 40 (Workstation Edition)
Graphics:
  Device-1: Intel TigerLake-H GT1 [UHD Graphics] driver: i915 v: kernel
  Device-2: Microdia HoverCam Solo Spark Audio driver: uvcvideo type: USB
  Device-3: Luxvisions Innotech Integrated RGB Camera driver: uvcvideo
    type: USB
  Display: wayland server: X.Org v: 24.1 with: Xwayland v: 24.1.0
    compositor: gnome-shell driver: X: loaded: fbdev,modesetting,vesa dri: iris
    gpu: i915 resolution: 1: 3840x2160~60Hz 2: 2560x1600~60Hz
  API: OpenGL v: 4.6 vendor: intel mesa v: 24.1.2 renderer: Mesa Intel UHD
    Graphics (TGL GT1)
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
$ loginctl show-session $(loginctl show-user $(whoami) -p Display --value) -p Type --value
wayland
$ xrandr --listactivemonitors
Monitors: 2
 0: +*DP-2 3840/700x2160/400+0+0  DP-2
 1: +eDP-1 2560/340x1600/220+3840+0  eDP-1
$ xrandr | grep -v " disconnected"
 Screen 0: minimum 16 x 16, current 6400 x 2160, maximum 32767 x 32767
eDP-1 connected 2560x1600+3840+0 (normal left inverted right x axis y axis) 340mm x 220mm
   2560x1600     59.99*+
   2048x1536     60.01  
   1920x1440     59.97  
   1600x1200     59.96  
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1920x1200     59.96  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.96  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   2560x1440     59.96  
   2048x1152     59.98  
   1920x1080     59.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  
DP-2 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 700mm x 400mm
   3840x2160     59.98*+
   2048x1536     59.95  
   1920x1440     59.90  
   1600x1200     59.87  
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   2560x1600     59.94  
   1920x1200     59.88  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.75  
   960x600       59.63  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   3200x1800     59.96  
   2880x1620     59.96  
   2560x1440     59.96  
   2048x1152     59.90  
   1920x1080     59.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77
$ lspci | grep -i 'vga\|3d\|2d'
00:02.0 VGA compatible controller: Intel Corporation TigerLake-H GT1 [UHD Graphics] (rev 01)
$ sudo lshw -class display
  *-display                 
       description: VGA compatible controller
       product: TigerLake-H GT1 [UHD Graphics]
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 01
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: iomemory:600-5ff iomemory:400-3ff irq:163 memory:603c000000-603cffffff memory:4000000000-400fffffff ioport:3000(size=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40ffffffff
$ uname -a
Linux fedora 6.9.7-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 27 18:11:45 UTC 2024 x86_64 GNU/Linux
$ dbus-monitor --session sender=org.flameshot.Flameshot
signal time=1720504884.891653 sender=org.freedesktop.DBus -> destination=:1.1146 serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.1146"
signal time=1720504884.891669 sender=org.freedesktop.DBus -> destination=:1.1146 serial=4294967295 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.1146"
method call time=1720504899.863251 sender=:1.1151 -> destination=org.freedesktop.DBus serial=13 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.a11y.Bus',arg1=''"
method call time=1720504899.863268 sender=:1.1151 -> destination=org.freedesktop.DBus serial=14 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
   string "org.a11y.Bus"
method call time=1720504899.863320 sender=:1.1151 -> destination=org.freedesktop.DBus serial=15 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.a11y.Bus'"
method call time=1720504899.863338 sender=:1.1151 -> destination=org.freedesktop.DBus serial=16 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.a11y.Bus"
method call time=1720504899.863389 sender=:1.1151 -> destination=org.a11y.Bus serial=17 path=/org/a11y/bus; interface=org.freedesktop.DBus.Properties; member=Get
   string "org.a11y.Status"
   string "ScreenReaderEnabled"
method call time=1720504899.863958 sender=:1.1151 -> destination=org.a11y.Bus serial=18 path=/org/a11y/bus; interface=org.freedesktop.DBus.Properties; member=Get
   string "org.a11y.Status"
   string "IsEnabled"
method call time=1720504928.478361 sender=:1.1151 -> destination=org.freedesktop.Notifications serial=19 path=/org/freedesktop/Notifications; interface=org.freedesktop.DBus.Introspectable; member=Introspect
method call time=1720504928.478837 sender=:1.1151 -> destination=org.freedesktop.DBus serial=20 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.Notifications'"
method call time=1720504928.478856 sender=:1.1151 -> destination=org.freedesktop.DBus serial=21 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
   string "org.freedesktop.Notifications"
method call time=1720504928.478992 sender=:1.1151 -> destination=org.freedesktop.Notifications serial=22 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "flameshot"
   uint32 0
   string "flameshot"
   string "Flameshot Info"
   string "Capture saved to clipboard. Capture saved as /home/foobar/Pictures/Screenshots/Tue_09_Jul_2024_11-32-08.png"
   array [
   ]
   array [
      dict entry(
         string "x-kde-urls"
         variant             array [
               string "file:///home/foobar/Pictures/Screenshots/Tue_09_Jul_2024_11-32-08.png"
            ]
      )
   ]
   int32 5000
method call time=1720504928.493468 sender=:1.1151 -> destination=org.freedesktop.DBus serial=23 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.Notifications'"
method return time=1720504928.504283 sender=:1.1151 -> destination=:1.1160 serial=24 reply_serial=22
anilv4 commented 1 month ago

This issue happened again.

Sharing the log,

Jul 11 11:40:39 fedora xdg-desktop-por[5770]: Failed to associate portal window with parent window                                                                                                                              
Jul 11 11:40:39 fedora xdg-desktop-por[5463]: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a 
system access dialog                                                                                                                                                                                                            
Jul 11 11:40:39 fedora org.flameshot.Flameshot.desktop[337746]: flameshot: error: Unable to capture screen                                                                                                                      
Jul 11 11:40:39 fedora org.flameshot.Flameshot.desktop[337746]: flameshot: error: Unable to capture screen
StarSpace369 commented 1 month ago

Flameshot v12.1.0 Ubuntu 24.04

This works for me:

Take the screenshot as you normally do and as many times you'd like, the flameshot is now working as normal.

If you restart your computer, then you have to redo the above steps.

Good luck!

sgdesmet commented 1 month ago

Same issue here (also Fedora 40 on Gnome with Wayland) . When I run flameshot gui from the terminal it seems to work reliably. Afterwards, using 'Take screenshot' from the tray icon also keeps working. Using the custom keyboard shortcut assigned to flameshot gui does not

Jul 17 10:57:35 thinkpad flameshot[247258]: flameshot: info: Screenshot aborted.
Jul 17 10:57:35 thinkpad flameshot[247258]: flameshot: error: Unable to capture screen
Jul 17 10:57:35 thinkpad flameshot[247258]: flameshot: error: Unable to capture screen
Jul 17 10:57:35 thinkpad xdg-desktop-por[96402]: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is a>
Jul 17 10:57:35 thinkpad xdg-desktop-por[96652]: Failed to associate portal window with parent window 
Jul 17 10:57:34 thinkpad systemd[2829]: Started app-gnome-flameshot-247258.scope - Application launched by gsd-media-keys.
PororoManon commented 3 weeks ago

me too. I using Fedora 40 wayland. If I run it through terminal using flameshot gui or flameshot gui -d 2000, it work perfectly. but it wont work on shortcut.

here's the log

10:34:03 AM flameshot: flameshot: info: Screenshot aborted.
10:34:03 AM flameshot: flameshot: error: Unable to capture screen
10:34:03 AM flameshot: flameshot: error: Unable to capture screen
10:34:03 AM xdg-desktop-por: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
10:34:03 AM xdg-desktop-por: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
10:34:03 AM xdg-desktop-por: Failed to associate portal window with parent window 
10:34:03 AM systemd: Started app-gnome-flameshot-36979.scope - Application launched by gsd-media-keys.
❯ inxi --width 80 --system --graphics
System:
  Host: PC Kernel: 6.9.10-200.fc40.x86_64 arch: x86_64 bits: 64
  Desktop: GNOME v: 46.3.1 Distro: Fedora Linux 40 (Workstation Edition)
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] driver: i915 v: kernel
  Device-2: NVIDIA GP108M [GeForce MX250] driver: nvidia v: 555.58.02
  Device-3: IMC Networks USB2.0 HD UVC WebCam driver: uvcvideo type: USB
  Display: wayland server: X.Org v: 24.1.1 with: Xwayland v: 24.1.1
    compositor: gnome-shell driver: X: loaded: modesetting dri: iris gpu: i915
    resolution: 1920x1080~60Hz
  API: OpenGL v: 4.6 vendor: intel mesa v: 24.1.4 renderer: Mesa Intel UHD
    Graphics 620 (WHL GT2)
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
dmitry-mightydevops commented 2 weeks ago

Same thing on fedora 40, wayland image

also the flameshot icon is not displayed in the top bar, it used to be, but not anymore. So CLI is the only way image

anilv4 commented 1 week ago

The issue happened when I autostart flameshot using its "launch at startup" option. I will no longer face the issue if I manually add flameshot to autostart via the gnome-tweak tool. I could not find a difference between how the above two startup methods differ, but I am no longer facing those "screenshot" abort issues.

Hope someone can verify this workaround.

Regards, Anil

PororoManon commented 1 week ago

I read it somewhere, I forgot the source, but it works on my Fedora 40 Gnome 46 Wayland . will update it when I can find it. Create a new file on /usr/local/bin, name it whatever you want. I name it flameshot-gui-workaround add this to your file

#!/bin/bash
flameshot gui

do chmod +x yourfile

on shortcut, in command input the file name you saved before.

dmitry-mightydevops commented 1 week ago

@PororoManon helped me! Thanks!