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

Unable to capture screen on Ubuntu 21.04 #1622

Closed
aryzing opened this issue May 14, 2021 · 51 comments
Closed

Unable to capture screen on Ubuntu 21.04 #1622

aryzing opened this issue May 14, 2021 · 51 comments
Assignees
Labels
Wayland Wayland specific issues

Comments

@aryzing
Copy link

aryzing commented May 14, 2021

Flameshot version

$ flameshot -v
Flameshot v0.9.0
Compiled with Qt 5.12.3

Describe the bug

The app can not capture the screen, and silently fails. There's a popup notification that alerts to its inability to capture screen,

Screenshot from 2021-05-14 11-52-59

To Reproduce

Simply open the app using the via "Take Screenshot" or "Open Launcher" menu items

Expected behavior

Should capture screen

System Information

  • Ubuntu 21.04, 64 bit
  • Gnome 3.38.5
  • Windowing System: Wayland
@holazt holazt added the Wayland Wayland specific issues label May 16, 2021
@wizardion
Copy link

I'm having exactly the same issue when the nouveau driver is installed for my Nvidia GeForce GTX 950. With proprietary drivers, it works well.

Flameshot v0.10.0
Compiled with Qt 5.12.3

@mmahmoudian
Copy link
Member

@wizardion can you confirm that you also are using Wayland?

@wizardion
Copy link

not sure how to check it, it's ubuntu 21.04 with default configurations.

@mmahmoudian
Copy link
Member

@wizardion please read this page:

https://flameshot.org/guide/issue-reporting/

Easiest way is:

inxi --width 80 --system --graphics

@wizardion
Copy link

wizardion commented Jun 17, 2021

@mmahmoudian it's x11. - sorry for the confusion. It's wayland

@wizardion
Copy link

wizardion commented Jun 17, 2021

I've just checked this again with the same nouveau driver but with X11 (switched to this) - and with X11 it's working. So the reason for this issue is Wayland.

@ampaiva
Copy link

ampaiva commented Jun 17, 2021

The workaround is to use Ubuntu on Xorg as per this reference: https://askubuntu.com/questions/1344236/shutter-screenshot-application-is-broken-since-upgrade-to-ubuntu-21-04-hirsute-h

@mmahmoudian
Copy link
Member

mmahmoudian commented Jun 18, 2021

@ampaiva Of course the workaround you mentioned will work, but Wayland is the future and more and more distros are adopting it in their stable releases. Wayland has many rough edges and issues but we are trying to make Flameshot to also support Wayland.

There are three layers to this though:

  1. The Wayland bugs
  2. The QT compatibility with Wayland
  3. The Flameshot compatibility with Wayland

And we can only and only address the 3rd one.

@websitevirtuoso
Copy link

websitevirtuoso commented Jul 12, 2021

Doesn't work on KDE plasma 5.22.1 on Wayland (distro KDE neon). I can provide debug info, if you need. Just let me know

@mmahmoudian
Copy link
Member

@websitevirtuoso for the time being the output of the following would be sufficient:

inxi --width 80 --system --graphics

@websitevirtuoso
Copy link

websitevirtuoso commented Jul 13, 2021

@mmahmoudian sure. let me know if you need more
Very good programm

System:
Host: blade Kernel: 5.4.0-60-generic x86_64 bits: 64
Desktop: KDE Plasma 5.22.1 Distro: KDE neon 20.04 5.22
Graphics:
Device-1: Intel UHD Graphics driver: i915 v: kernel
Device-2: NVIDIA TU106 [GeForce RTX 2060] driver: nvidia v: 465.27
Display: wayland server: X.Org 1.20.9 driver: modesetting,nvidia
unloaded: fbdev,nouveau,vesa resolution: 1920x1080~144Hz
OpenGL: renderer: Mesa Intel UHD Graphics (CML GT2) v: 4.6 Mesa 20.2.6

@zlobme
Copy link

zlobme commented Aug 3, 2021

Same issue

System:
  Host: kpad Kernel: 5.11.0-25-generic x86_64 bits: 64 Desktop: Unity 
  Distro: Ubuntu 21.04 (Hirsute Hippo) 
Graphics:
  Device-1: AMD Renoir driver: amdgpu v: kernel 
  Device-2: Chicony Integrated Camera type: USB driver: uvcvideo 
  Display: wayland server: X.Org 1.21.1.1 driver: loaded: amdgpu 
  note: n/a (using device driver) resolution: 1920x1080~60Hz 
  OpenGL: renderer: AMD RENOIR (DRM 3.40.0 5.11.0-25-generic LLVM 11.0.1) 
  v: 4.6 Mesa 21.0.1 

@mmahmoudian
Copy link
Member

@zlobme you are the first one in this thread that is not using Nvidia which is interesting considering that @wizardion mentioned that the issue does not exist on proprietary Nvidia driver, and @websitevirtuoso is also using nouveau.

Anyhow, would you all kindly do:

  1. open two terminals
  2. in the first terminal:
    pkill flameshot
    flameshot --version
    flameshot
  3. in the second terminal:
    flameshot gui

then send post here the output of the first terminal when it fails.

@zlobme
Copy link

zlobme commented Aug 3, 2021

@mmahmoudian sure, here it's:

$ flameshot --version
Flameshot v0.10.1
Compiled with Qt 5.12.3
$ flameshot
Qt: Session management error: Could not open network socket
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.210\" (uid=1000 pid=35012 comm=\"/snap/flameshot/135/usr/bin/flameshot \" label=\"snap.flameshot.flameshot (enforce)\") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=833 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
nmReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.210\" (uid=1000 pid=35012 comm=\"/snap/flameshot/135/usr/bin/flameshot \" label=\"snap.flameshot.flameshot (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=833 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
"Object path cannot be empty"

@mmahmoudian
Copy link
Member

mmahmoudian commented Aug 3, 2021

@zlobme I can't believe I didn't suspected this earlier for this thread! You are using Snap. I wonder if others (@aryzing @wizardion @websitevirtuoso) have also installed Flameshot with Snap (or Flatpak).

These solutions are sort of "sandbox"ing the software as well, therefore certain permissions should be granted to them, as also pointed out in:

@zlobme As explained in Snap documentation, would you please provide me the output of snap connections flameshot

@zlobme
Copy link

zlobme commented Aug 3, 2021

@mahmoudian here's connection output:

$ snap connections flameshot 
Interface                             Plug                             Slot                                                  Notes
content[icon-themes]                  flameshot:icon-themes            gtk-common-themes:icon-themes                         -
content[kde-frameworks-5-core18-all]  flameshot:kde-frameworks-5-plug  kde-frameworks-5-core18:kde-frameworks-5-core18-slot  -
content[sound-themes]                 flameshot:sound-themes           gtk-common-themes:sound-themes                        -
dbus                                  -                                flameshot:dbus-flameshot                              -
desktop                               flameshot:desktop                :desktop                                              -
desktop-legacy                        flameshot:desktop-legacy         :desktop-legacy                                       -
home                                  flameshot:home                   :home                                                 -
network                               flameshot:network                :network                                              -
network-bind                          flameshot:network-bind           :network-bind                                         -
opengl                                flameshot:opengl                 :opengl                                               -
pulseaudio                            flameshot:pulseaudio             -                                                     -
removable-media                       flameshot:removable-media        -                                                     -
unity7                                flameshot:unity7                 :unity7                                               -
wayland                               flameshot:wayland                :wayland                                              -
x11                                   flameshot:x11                    :x11                                                  -

Screenshot from 2021-08-03 23-02-30

@mmahmoudian
Copy link
Member

mmahmoudian commented Aug 3, 2021

@zlobme I'm not personally very experienced with snaps but considering the AppArmor error you got and the dbus connection of your snap, I suspect that this is because of dbus connection. Perhaps @borgmanJeremy can provide more insight regarding this error you and this config and the Wayland.

@zlobme
Copy link

zlobme commented Aug 3, 2021

I just try sudo apt install flameshot, no problems so far. Snap is in charge in my case.

$ flameshot --version
Flameshot v0.8.5-4(Debian)
Compiled with Qt 5.15.2

@borgmanJeremy
Copy link
Contributor

Hmmm, I think the snap is correct. It works for me on Arch + KDE + X11, I am not running AppArmor.

@mmahmoudian
Copy link
Member

@borgmanJeremy there are many moving parts in play. The setup @zlobme has is as different as it can get from our setup. He has Ubuntu+Unity+Wayland+AppArmor and I think AppArmor is by default shipped with Ubuntu. I'll try to create a VM with similar setup (no Unity) and see if I can reproduce this.

@mmahmoudian mmahmoudian self-assigned this Aug 4, 2021
@websitevirtuoso
Copy link

@mmahmoudian
1 terminal

viktord@blade:$ pkill flameshot
viktord@blade:
$ flameshot --version
Flameshot v0.10.0
Compiled with Qt 5.15.3
viktord@blade:~$ flameshot
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed

In the second terminal I did command
flameshot gui
and in first terminal appeared one extra message
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

@websitevirtuoso
Copy link

websitevirtuoso commented Aug 20, 2021

Still doesn't work,

@mmahmoudian
Copy link
Member

@websitevirtuoso how have you installed Flameshot on you KDE Neon?

@websitevirtuoso
Copy link

I build it by instruction on github. To use latest version

@websitevirtuoso
Copy link

Build
After installing all the dependencies, finally run the following commands in the sources root directory:

mkdir build
cd build
cmake ../
make

@websitevirtuoso
Copy link

I even tried to remove it and install via apt-get install flameshot. but the same error

@guirahy
Copy link

guirahy commented Aug 26, 2021

Hi, same issue, follow all information

# flameshot --version

Flameshot v0.10.1
Compiled with Qt 5.12.3

# inxi --width 80 --system --graphics

System:
  Host: hostname-anonymous Kernel: 5.11.0-31-generic x86_64 bits: 64 
  Desktop: GNOME 3.38.4 Distro: Ubuntu 21.04 (Hirsute Hippo) 
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics driver: i915 v: kernel 
  Device-2: NVIDIA GK208M [GeForce GT 740M] driver: N/A 
  Device-3: Realtek Integrated Webcam HD type: USB driver: uvcvideo 
  Display: wayland server: X.Org 1.21.1.1 driver: loaded: modesetting 
  unloaded: fbdev,vesa resolution: 1: 1280x1024~60Hz 2: 1366x768~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4400 (HSW GT2) 
  v: 4.5 Mesa 21.0.3 

# loginctl show-session $(loginctl show-user $(whoami) -p Display --value) -p Type --value

wayland

# xrandr --listactivemonitors

Monitors: 2
 0: +*XWAYLAND0 1280/340x1024/270+1366+0  XWAYLAND0
 1: +XWAYLAND1 1366/310x768/170+0+151  XWAYLAND1

# xrandr | grep -v " disconnected "

Screen 0: minimum 16 x 16, current 2646 x 1024, maximum 32767 x 32767
XWAYLAND0 connected primary 1280x1024+1366+0 (normal left inverted right x axis y axis) 340mm x 270mm
   1280x1024     59.89*+
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1280x800      59.81  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  
XWAYLAND1 connected 1366x768+0+151 (normal left inverted right x axis y axis) 310mm x 170mm
   1366x768      59.80*+
   1024x768      59.68  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   720x480       59.71  
   640x400       59.20  
   320x200       58.96  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77 

# update-pciids  # you might need to run this with sudo
# lspci | grep -i 'vga\|3d\|2d'
/usr/share/misc/pci.ids is read-only, exiting.
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
08:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)

# in some systems lshw is not installed by default
lshw -class display

WARNING: you should run this program as super-user.
  *-display                 
       description: VGA compatible controller
       product: Haswell-ULT Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:49 memory:f7400000-f77fffff memory:d0000000-dfffffff ioport:f000(size=64) memory:c0000-dffff
  *-display UNCLAIMED
       description: 3D controller
       product: GK208M [GeForce GT 740M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:08:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: bus_master cap_list
       configuration: latency=0
       resources: memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:d000(size=128) memory:f7000000-f707ffff
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.

# uname -a

Linux hostname-anonymous 5.11.0-31-generic #33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

@rainbowjose
Copy link

Exactly the same problem, Ubuntu 21.04 Wayland. Tried snap and flatpak versions.

Apt and deb working properly.

@nycmitch25
Copy link

I had the same issue, uninstalled and installed it like this on my Ubunutu 21.04

sudo apt install flameshot

@VitalyAnkh
Copy link

I had the same issue, with Gnome 41 on Wayland, Arch Linux, flameshot r1522.dabc5965-1, or flameshot 0.10.1.

@smissaertj
Copy link

Same issue on Fedora 35 with Gnome 41.1 on Wayland:

Flameshot v0.10.1
Compiled with Qt 5.15.2

Linux Ryzen7 5.14.16-301.fc35.x86_64 

@brownchow
Copy link

same issue on arch linux with Gnome

@xipho
Copy link

xipho commented Nov 12, 2021

Same issue on Fedora 35 with Gnome 41.1 on Wayland:

Flameshot v0.10.1
Compiled with Qt 5.15.2

Linux Ryzen7 5.14.16-301.fc35.x86_64 

Same issue too on Fedora 35 with Gnome 41 Wayland session
Linux fedora 5.14.16-301.fc35.x86_64 #1 SMP Wed Nov 3 13:55:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

@mstoss
Copy link

mstoss commented Nov 12, 2021

Same issue with archlinux:

flameshot -v
Flameshot v0.10.1
Compiled with Qt 5.15.2

flameshot
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed

loginctl show-session $(loginctl show-user $(whoami) -p Display --value) -p Type --value
wayland

inxi --width 80 --system --graphics
System:
Host: gasp Kernel: 5.14.16-arch1-1 x86_64 bits: 64 Desktop: GNOME 41.1
Distro: Arch Linux
Graphics:
Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] driver: i915 v: kernel
Device-2: CN0HK46K8LG0004ND0SKA02 Integrated_Webcam_HD type: USB
driver: uvcvideo
Display: wayland server: X.org 1.21.1.1 driver: loaded: i915
note: n/a (using device driver) - try sudo/root
resolution: <missing: xdpyinfo>
Message: Unable to show advanced data. Required tool glxinfo missing.

@borgmanJeremy
Copy link
Contributor

This is a duplicate of #1910

@ghost
Copy link

ghost commented Nov 19, 2021

Hello.
Same issue

$ inxi --width 80 --system --graphics

System:
  Host: thinkt440 Kernel: 5.15.2-arch1-1 x86_64 bits: 64 Desktop: GNOME 41.1
  Distro: Arch Linux
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics driver: i915 v: kernel
  Display: wayland server: X.Org 1.21.1.3 driver: loaded: i915
  note: n/a (using device driver) - try sudo/root resolution: 1366x768~60Hz
  Message: Unable to show advanced data. Required tool glxinfo missing.

$ flameshot

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed

$flameshot --version

Flameshot v0.10.1
Compiled with Qt 5.15.2

@ghost
Copy link

ghost commented Nov 19, 2021

If I switch to X11, Flameshot works.

$ inxi --width 80 --system --graphics

System:
  Host: thinkt440 Kernel: 5.15.2-arch1-1 x86_64 bits: 64 Desktop: GNOME 41.1
  Distro: Arch Linux
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics driver: i915 v: kernel
  Display: x11 server: X.Org 1.21.1.1 driver: loaded: intel
  unloaded: modesetting,vesa resolution: 1366x768~60Hz
  Message: Unable to show advanced data. Required tool glxinfo missing.

image

Sorry for my bad english.

@mmahmoudian
Copy link
Member

@hristo-chavez We have put together a quick fix for this and we released v0.10.2 to handle Gnome 41 Wayland issue. Pleasr either upgrade to Flameshot v0.10.2 or use our AUR flameshot-git

@201dreamers
Copy link

Hi, seeing the same issue on v0.10.2. Manjaro
inxi

System:
  Host: dsydll Kernel: 5.15.2-2-MANJARO x86_64 bits: 64 Desktop: GNOME 41.1
  Distro: Manjaro Linux
Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel
  Device-2: Sunplus Innovation Integrated_Webcam_HD type: USB driver: uvcvideo
  Display: wayland server: X.org 1.21.1.1 driver: loaded: i915
  note: n/a (using device driver) - try sudo/root
  resolution: <missing: xdpyinfo>
  OpenGL: renderer: Mesa Intel Xe Graphics (TGL GT2) v: 4.6 Mesa 21.2.5

flameshot

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed

flameshot --version

Flameshot v0.10.2
Compiled with Qt 5.15.2

@VitalyAnkh
Copy link

VitalyAnkh commented Dec 3, 2021 via email

@201dreamers
Copy link

It launches gnome screenshot tool

@201dreamers

This comment was marked as off-topic.

@mdxe

This comment was marked as off-topic.

@201dreamers

This comment was marked as off-topic.

@mdxe

This comment was marked as off-topic.

@201dreamers

This comment was marked as off-topic.

@mdxe

This comment was marked as off-topic.

@matheusrdb

This comment was marked as off-topic.

@spupuz

This comment was marked as duplicate.

@StayPirate
Copy link

StayPirate commented Feb 21, 2023

I'd like to mention that I had similar problem on Archlinux and Wayland using Sway. I managed to make it work by installing grim as explained in #1356 (comment).

I guess this is an Archlinux problem at packaging level, I will suggest the arch maintainer to add grim as dependency for flameshot.

Update: this seems to be addressed via #3018, but the build-option is not used in Archlinux official build, nor in AUR yet.

I'm wondering if it's worthy to add the install grim workaround to https://flameshot.org/docs/guide/wayland-help/.

@dewme52
Copy link

dewme52 commented May 14, 2024

Way late to the game, but I was just having this issue in Fedora, I think related to Wayland, but not sure. I had created a quick key to launch "flameshot gui" but that would result in a failure notice. I assume it was only executing on the first word "flameshot" and not adding the "gui" instruction. I created a simple script that I now call with the quick key instead.

#!/bin/bash flameshot gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wayland Wayland specific issues
Projects
None yet
Development

No branches or pull requests