flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

"Unable to capture screen" on Ubuntu 22.04.3 LTS

Open ryancwalsh opened this issue 1 year ago • 23 comments

Flameshot Version

flameshot --version Flameshot v11.0.0 (11.0.0-2 Debian) Compiled with Qt 5.15.2

Installation Type

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

Operating System type and version

Ubuntu 22.04.3 LTS

Description

I've used Flameshot in the past.

But ever since trying to install Flameshot on Ubuntu 22.04.3 LTS (via sudo apt install flameshot), I can't get it to work.

I saw that https://flameshot.org/docs/guide/wayland-help/ mentions xdg-desktop-portal-gnome and xdg-desktop-portal, which I assume meant:

sudo apt install xdg-desktop-portal-gnome
sudo apt install xdg-desktop-portal

So I did that too.

Steps to reproduce

I search Ubuntu for Flameshot and click the icon. Now I see the Flameshot icon in the menu bar of Ubuntu, but if I click Take Screenshot or Open Launcher, nothing happens.

Then if I click Quit, the app quits but suddenly triggers various notifications saying "Unable to capture screen".

Alternatively, in Terminal, I try to run flameshot gui but it just hangs with this warning:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

And I don't know what that means.

I found https://github.com/flameshot-org/flameshot/issues/3383#issuecomment-1789630803 but /bin/sh -c '/usr/bin/flameshot gui' hangs with the same warning.

Screenshots or screen recordings

No response

System Information

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

System: Host: ThinkPad-E15-Gen-2 Kernel: 6.5.0-14-generic x86_64 bits: 64 Desktop: GNOME 42.9 Distro: Ubuntu 22.04.3 LTS (Jammy Jellyfish) Graphics: Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel Device-2: Logitech Webcam C270 type: USB driver: snd-usb-audio,uvcvideo Device-3: Luxvisions Innotech Integrated Camera type: USB driver: uvcvideo Display: wayland server: X.Org v: 1.22.1.1 with: Xwayland v: 22.1.1 compositor: gnome-shell driver: X: loaded: modesetting unloaded: fbdev,vesa gpu: i915 resolution: 3840x2160~60Hz OpenGL: renderer: Mesa Intel Xe Graphics (TGL GT2) v: 4.6 Mesa 23.0.4-0ubuntu1~22.04.1

xrandr --listactivemonitors Monitors: 1 0: +*XWAYLAND0 3840/940x2160/530+0+0 XWAYLAND0

update-pciids lspci | grep -i 'vga|3d|2d' /usr/share/misc/pci.ids is read-only, exiting. 00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)

uname -a Linux ThinkPad-E15-Gen-2 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ryancwalsh avatar Feb 11 '24 18:02 ryancwalsh

same issue here with flameshot v12.1.0 on Debian 12's packages, on GNOME 43 wayland, the tray does nothing at all and quitting triggers those unable to capture notifications

ravener avatar Feb 19 '24 08:02 ravener

same issue with me

Flameshot v11.0.0 (11.0.0-2 Debian)
Compiled with Qt 5.15.2
linux: 5.15.0-97-generic
ubuntu: 22.04

dattran92 avatar Mar 03 '24 08:03 dattran92

Hi, I do highly recommend you to check these issues created in the past with workarounds:

https://github.com/flameshot-org/flameshot/issues/2590#issuecomment-1122196178 https://github.com/flameshot-org/flameshot/issues/2560#issuecomment-1223943716 (in my case that worked)

cxzero avatar Mar 05 '24 14:03 cxzero

Hi, I do highly recommend you to check these issues created in the past with workarounds:

#2590 (comment) #2560 (comment) (in my case that worked)

@cxzero Unfortunately that involves switching to X11 which is what I'm trying to avoid, I'd like to see flameshot working on wayland if possible.

ravener avatar Mar 05 '24 16:03 ravener

It seems that the launcher may be broken but for single screenshots via the command flameshot gui it works fine, my use case was to bind a script to a key so the script can automatically upload the image to some server and for that it works fine.

ravener avatar Mar 17 '24 14:03 ravener

Follow these steps to install your flameshot and use it as usual without any issues.

Remove all the installed versions of flameshot and don't install it from snapstore

  1. Install the flameshot using this command sudo apt-get install flameshot
  2. Now, navigate to /etc/gdm3/custom.conf
  3. Remove the comment on #WaylandEnable=false
  4. Basically your custom.conf file will look like the below code
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

# Enabling automatic login
#  AutomaticLoginEnable = true
#  AutomaticLogin = user1

# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
  1. Save this file and restart your machine, thank me later :)

Bhagavan-Bollina avatar Mar 29 '24 06:03 Bhagavan-Bollina

Hi, I do highly recommend you to check these issues created in the past with workarounds:

#2590 (comment) #2560 (comment) (in my case that worked)

Had same kind of Issue earlier and raised a request too but the fix I feel for this is disable wayland , this will fix much of it but will trigger issues for other applications Like you cant use 3 finger swipe

sharpsailor avatar Jul 03 '24 07:07 sharpsailor

Yeah, struggling with flameshot after upgrading to ubuntu 24.04 (and after several years of perfect work) I dont see an option to switch back from wayland to X11.

vladimirshefer avatar Jul 06 '24 21:07 vladimirshefer

Yeah, struggling with flameshot after upgrading to ubuntu 24.04 (and after several years of perfect work) I dont see an option to switch back from wayland to X11.

I have found a smooth solution, try it:

  1. install xdotool: sudo apt install xdotool
  2. create a custom shortcut (as an example Super+Print) with the command: xdotool exec flameshot gui

As a result, xdotool loads "flameshot gui" without creating a terminal session that could appear in front of the screen's part you want to take as a screenshot.

Engimono avatar Jul 07 '24 17:07 Engimono

Follow these steps to install your flameshot and use it as usual without any issues.

Remove all the installed versions of flameshot and don't install it from snapstore

1. Install the flameshot using this command `sudo apt-get install flameshot`

2. Now, navigate to `/etc/gdm3/custom.conf`

3. Remove the comment on `#WaylandEnable=false`

4. Basically your `custom.conf` file will look like the below code
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

# Enabling automatic login
#  AutomaticLoginEnable = true
#  AutomaticLogin = user1

# Enabling timed login
#  TimedLoginEnable = true
#  TimedLogin = user1
#  TimedLoginDelay = 10

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
5. Save this file and restart your machine, thank me later :)

/etc/gdm3/custom.conf - file is not writable. first run: sudo chmod +x /etc/gdm3/custom.conf after that run all commands with sudo :)

Guvanchhojamov avatar Jul 12 '24 16:07 Guvanchhojamov

[daemon]

Uncomment the line below to force the login screen to use Xorg

WaylandEnable=false

@Guvanchhojamov this is the key point, your solution works too, but originally @vladimirshefer do not want to back to X11 server. The idea is to stay with Wayland session instead.

Engimono avatar Jul 12 '24 17:07 Engimono

Flameshot v12.1.0 Ubuntu 24.04

This works for me:

  • open the flameshot
  • click the flameshot icon on top right bar of ubuntu. do NOT click "Take Screenshot" yet, but click "Configuration" instead
  • with the flameshot configuration window opened, click the flameshot icon again on top right bar, this time click the "Take Screenshot", voila!

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!

StarSpace369 avatar Jul 16 '24 16:07 StarSpace369

Yeah, struggling with flameshot after upgrading to ubuntu 24.04 (and after several years of perfect work) I dont see an option to switch back from wayland to X11.

I have found a smooth solution, try it:

  1. install xdotool: sudo apt install xdotool
  2. create a custom shortcut (as an example Super+Print) with the command: xdotool exec flameshot gui

As a result, xdotool loads "flameshot gui" without creating a terminal session that could appear in front of the screen's part you want to take as a screenshot.

This worked for me, awesome!

ElVisPL avatar Jul 17 '24 13:07 ElVisPL

Yeah, struggling with flameshot after upgrading to ubuntu 24.04 (and after several years of perfect work) I dont see an option to switch back from wayland to X11.

I have found a smooth solution, try it:

  1. install xdotool: sudo apt install xdotool
  2. create a custom shortcut (as an example Super+Print) with the command: xdotool exec flameshot gui

As a result, xdotool loads "flameshot gui" without creating a terminal session that could appear in front of the screen's part you want to take as a screenshot.

This worked for me, awesome!

This workaround works! Thanks!

DeviDarkL avatar Aug 18 '24 21:08 DeviDarkL

I'm not sure if this is related, but I'm running Flameshot v12.1.0 on Ubuntu 24.04 LTS and it's set to automatically start on system startup, but every time I try capturing a screenshot it says "Unable to capture screen". If I quit and re-launch Flameshot manually, it works normally. Should I open a new bug ticket for this?

woganmay avatar Aug 19 '24 15:08 woganmay