flameshot-org / flameshot

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

Flameshot not work in ubuntu 22.04 #2590

Closed panason closed 2 years ago

panason commented 2 years ago

Flameshot Version

Flameshot v11.0.0 () Compiled with Qt 5.15.3

Installation Type

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

Operating System type and version

Ubuntu 22.04

Description

https://bin.snopyta.org/?7f3a5673cc0eea36#6ryU2vWPL64ATEr7RbxZiEmyB8fqAGTUxWN2W5qaB2Jg

Steps to reproduce

No response

Screenshots or screen recordings

No response

System Information

System: Host: apanasovich-HP-ZBook-15u-G6 Kernel: 5.15.0-27-generic x86_64 bits: 64 Desktop: GNOME 42.0 Distro: Ubuntu 22.04 LTS (Jammy Jellyfish) Graphics: Device-1: Intel UHD Graphics 620 driver: i915 v: kernel Device-2: AMD Lexa XT [Radeon PRO WX 3200] driver: amdgpu v: kernel Device-3: Cheng Uei Precision Industry (Foxlink) HP Wide Vision HD Integrated Webcam 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: amdgpu,ati,modesetting unloaded: fbdev,vesa gpu: i915 resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz OpenGL: renderer: Mesa Intel UHD Graphics 620 (WHL GT2) v: 4.6 Mesa 22.0.1

panason commented 2 years ago

After install xdg-desktop-portal-gnome it work

wakjoko commented 2 years ago

unfortunately, after upgrading from 20.04 to 22.04 flameshot is not working anymore

tried with @panason way but not working either

executing flameshot gui show errors

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Qt: Session management error: Could not open network socket
propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.143\" (uid=1000 pid=15985 comm=\"/snap/flameshot/180/usr/local/bin/flameshot gui \" 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=949 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.143\" (uid=1000 pid=15985 comm=\"/snap/flameshot/180/usr/local/bin/flameshot gui \" label=\"snap.flameshot.flameshot (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=949 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
"Object path cannot be empty"
flameshot: error: Unable to capture screen
flameshot: error: Unable to capture screen
flameshot: info: Screenshot aborted.
mmahmoudian commented 2 years ago

@wakjoko please specify how you have installed Flameshot. I think you have installed via Snap and that's why AppArmor is doing that. Also provide your system information (Desktop Environment)

sahir-taib commented 2 years ago

yep, installed via snap @mmahmoudian

by default desktop should be wayland, never changed since Ubuntu 20.04

mmahmoudian commented 2 years ago

@sahir-taib your Display Server is Wayland, but what is your Desktop Environment (e.g. Gnome, KDE) or Window Manager (e.g. Sway)?

sahir-taib commented 2 years ago

it's gnome @mmahmoudian

hazg commented 2 years ago

same error.

No window on "Take screenshot" and "Open Launcher". Other dialogs - working. "Can't take screenshot" - after exit.

Ubuntu 22.04 LTS
gnome 42
wayland

nothing help.

> QT_QPA_PLATFORM=wayland flameshot       
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QSocketNotifier: Can only be used with threads started with QThread

I tried to use this instruction, but without success: https://lifesaver.codes/answer/flameshot-not-launching-when-using-wayland-675

mmahmoudian commented 2 years ago

@hazg what happens when you run the following

pkill flameshot
flameshot gui
hazg commented 2 years ago

@mmahmoudian in gdm3: image in lightdm - nothing

hazg commented 2 years ago

In my case, changing the window manager from lightdm to gdm3, plus maybe all the steps I described earlier helped.

mmahmoudian commented 2 years ago

@hazg I kinda feel that your issue is unrelated to this thread. please open a new one and add the screenshots and etc.). Please also post the link of the new issue here in case others with similar issue stumble upon it.

@sahir-taib Is your issue also similar to what @hazg described?

sahir-taib commented 2 years ago

yes @mmahmoudian, i'm seeing same popup as @hazg

annoying but have to live with it for now i can't find screenshot app better than flameshot :+1:

mmahmoudian commented 2 years ago

@sahir-taib If this pop-up is the reason you have been writing in this thread, you have been wasting your time! That popup is Gnome's thing, it has nothing to do with Flameshot.

I have explained it many many times in many different issues including but not limited to:

And if you want to read some the Gnome people's response on our repo:

⚠️ We have also explained it with all the details you might need on our website:

https://flameshot.org/docs/guide/wayland-help/#gnome

If you are annoyed, use a better Desktop Environment (e.g KDE, Xfce, LXQt)

sahir-taib commented 2 years ago

great! thanks @mmahmoudian

appreciate your efforts

hazg commented 2 years ago

@sahir-taib If this pop-up is the reason you have been writing in this thread, you have been wasting your time! That popup is Gnome's thing, it has nothing to do with Flameshot.

I have explained it many many times in many different issues including but not limited to:

And if you want to read some the Gnome people's response on our repo:

warning We have also explained it with all the details you might need on our website:

https://flameshot.org/docs/guide/wayland-help/#gnome

If you are annoyed, use a better Desktop Environment (e.g KDE, Xfce, LXQt)

Yes. It's just a dialog box for allowing screen captures. "kooha" does the same thing in wayland. Without this window, you can tell relatively accurately - a screenshot or screen recording will just be a dark square.

Sorry I got into this discussion without reading carefully enough.

Thanks for the program!

anandananda commented 2 years ago

I read this thread. My question is simple, Does Flameshot work in Ubuntu 22.04? I'm using Gnome DE w Wayland and Dash-to-Panel. I installed using apt. Flameshot worked fine in my 21.10 Gnome DE and Wayland. I installed Flameshot but when I click on the tiny Flameshot icon and click on "Take a Screenshot" nothing happens.

mmahmoudian commented 2 years ago

@anandananda

My question is simple, Does Flameshot work in Ubuntu 22.04?

Short simple answer: Yes

I installed Flameshot but when I click on the tiny Flameshot icon and click on "Take a Screenshot" nothing happens.

Please open a separate bug report as it seems your issue has nothing to do with Gnome. Inthe meanwhile try and report if running flameshot gui in terminal works for you.

anandananda commented 2 years ago

When I run the "flameshot gui" command the Flameshot screenshot tool opens on a black screen which is of no use.

I just now submitted the new bug report.

Should I try the Flameshot flatpak? Or will that mess with Flameshot apt?

PS: When it's working, Flameshot is a fantastic app! Very useful.

mmahmoudian commented 2 years ago

@anandananda

When I run the "flameshot gui" command the Flameshot screenshot tool opens on a black screen which is of no use.

Are you sure you have xdg-desktop-portal-gnome installed?

Should I try the Flameshot flatpak? Or will that mess with Flameshot apt?

You can install Flameshot from Flatpak and I cannot think of why it would mess with your apt install of Flameshot considering that their binary location and even commandline name is different. This is of course as long as you are not creating an alias for the flatpak (as explained on your website)

anandananda commented 2 years ago

I removed and purged Flameshot. Then I installed the Flameshot flatpak and that didn't work. Then I removed the Flameshot flatpalk.

Then I installed xdg-desktop-portal-gnome and then installed flameshot using apt. Flameshot still not working. I click on "Take Screenshot" and nothing happens.

Any ideas? Does Flameshot need some bug fixes and/or updates before it will work on Ubuntu 22.04? Thanks.

On Sun, Jun 12, 2022 at 10:38 PM Mehrad Mahmoudian @.***> wrote:

@anandananda https://github.com/anandananda

When I run the "flameshot gui" command the Flameshot screenshot tool opens on a black screen which is of no use.

Are you sure you have xdg-desktop-portal-gnome installed?

Should I try the Flameshot flatpak? Or will that mess with Flameshot apt?

You can install Flameshot from Flatpak and I cannot think of why it would mess with your apt install of Flameshot considering that their binary location and even commandline name is different. This is of course as long as you are not creating an alias for the flatpak (as explained on your website https://flameshot.org/docs/installation/installation-linux/#flatpak)

— Reply to this email directly, view it on GitHub https://github.com/flameshot-org/flameshot/issues/2590#issuecomment-1153235754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJOJ73OMSEPPGUT2Q2T6PYTVOYKO7ANCNFSM5VIGA2RA . You are receiving this because you were mentioned.Message ID: @.***>

mmahmoudian commented 2 years ago

@anandananda please remember that Ubuntu 22.04 is not a magical number and/or it is not even one single software stack. Therefore many things can be the potential cause if the information you are facing. On a clean install virtual machine I wasn't able to reproduce your issue. If you can reproduce the issue in a clean install VM, please let us know and send us the VM.

That said, I asked you to fill a bug report, which you did (#2659) and I don't understand why you are keep posting comments here when the issue you yourself opened is unanswered. I literally asked you to provide us with more info in #2659 an still no updates from you there.

liugang commented 2 years ago

Ubuntu has switched to Wayland session for a period of time. But some applications may still not working properly , e.g. flameshot. you may choose to switch back to the classic Xorg, then the "Share" button will disappear.

image

mmahmoudian commented 2 years ago

@liugang

But some applications may still not working properly , e.g. flameshot. you may choose to switch back to the classic Xorg, then the "Share" button will disappear.

This is NOT an issue from Flameshot. Gnome Wayland is forcing a public and restricted API on their users. Take your complaints to them. We cannot do anything. You can change your DE from Gnome to anything else though. All other non-gnome screenshot software are suffering because of this Gnome issue. Let's be more reasonable. For more information read this:

https://flameshot.org/docs/guide/wayland-help/#i-am-asked-to-share-my-screen-every-time

But if you or anyone else think this is a bug in Flameshot: As always, Flameshot is opensource, so you can create a pull request and fix the issues. Any positive contribution is always welcome.

anandananda commented 2 years ago

Update, Flameshot in Ubuntu 22.04 Gnome is now working for me, although I do have to go thru the extra step, which is no big deal. Hopefully Gnome will fix the underlying issue.

huaouo commented 2 years ago

Ubuntu has switched to Wayland session for a period of time. But some applications may still not working properly , e.g. flameshot. you may choose to switch back to the classic Xorg, then the "Share" button will disappear.

image

Or edit /etc/gdm3/custom.conf and set WaylandEnable=false to disable wayland by default, then everything works.

mdsulaiman7870 commented 2 years ago

Gnome is now working. the "Share" button has been available now but there is one issue. When I save my screenshot by pressing "Ctrl+S" it gives me an error "The Folder contents could not be displayed. Operation was canceled." After clicking on "Ok" button, it displays then a location where I can save my SS. Then I select a folder but still not able to save my SS there. The SS will save if and only if there is any other Picture present in the folder, so select that available picture, and Flamshot will give you a popup that "A filename "your_existing_filename" is already exist, do you want to replace", don't worry just click on Replace button and there we go. Both the pictures will be present in the folder. (your existing picture and your new Screenshot". I hope they will fix this issue too soon.

mmahmoudian commented 2 years ago

@Salman7870 I'm not sure if I understood what exactly you mean have done. Would it be possible for you to record a short video and post it here? I suggest using peek.

AlexandreBrown commented 2 years ago

For me running the lateset flameshot version (12.1) on Ubuntu 22.04 Gnome Wayland and trying all the fixes mentioned here did not fix my issue.
When running flameshot gui or using the shortcut I would get a black screen and it would terminate flameshot.

For me the fix was to change the scaling from 125% back to 100%.

Screenshot from 2022-07-27 09-04-44

evdcush commented 2 years ago

I thought my recent buggy experience with flameshot was due to some issues Jammy. When I attempted to use flameshot, the screen would go black and stutter.

Turns out it is due to a very old flameshot bug with fractional scaling: https://github.com/flameshot-org/flameshot/issues/564

The suggested workarounds in that bug fixed the issue for me:

env QT_AUTO_SCREEN_SCALE_FACTOR=1 flameshot gui
Prodeguerriero commented 2 years ago

A bit of an odd addition from me, but maybe someone can help shedding some light on my situation.

I have Ubuntu 22.04 LTS installed on two machines. My desktop computer and my laptop. I have installed Flameshot on both systems, quite long ago on the Desktop, just now on the laptop, and the tool behaves differently:

I honestly have no idea how I got my desktop machine to work differently, but it does. My best guess is that this was not a clean 22.04 installation, but rather an update from a previous Ubuntu version.

Scratch that. Apparently I am using X11 instead of Wayland on my desktop. This explains the behavior, I think.

mmahmoudian commented 2 years ago

on my desktop, I can grab screenshots just fine, without the intermediate GNOME screenshot utility getting in the way

Apparently I am using X11 instead of Wayland on my desktop. This explains the behavior, I think.

Yes, that is the reason. This is explained here: https://flameshot.org/docs/guide/wayland-help/#i-am-asked-to-share-my-screen-every-time

edggoncalves commented 1 year ago

Not sure if helpful, but might be worth to mention that over in 4895 the dev team is forwarding complaints to https://github.com/flatpak/xdg-desktop-portal/issues/649

laoshaw commented 1 year ago

for my ubuntu 22.04, x11 works fine, wayland does not, tried all the methods mentioned here.

laoshaw commented 1 year ago

env QT_AUTO_SCREEN_SCALE_FACTOR=1 flameshot gui

I don't have fractional scaling and still could not get it to work, it's a wayland vs x11 problem to me. on x11 it works, on wayland it does not.

kevint324 commented 1 year ago

I switched from lightdm to gdb3 and flameshot stopped working

x@desktop:~$ flameshot gui
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.xcb: could not connect to display wayland-0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)
thw@thw-desktop:~$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
fuzunspm commented 1 year ago

same issue

kevint324 commented 1 year ago

I switched from lightdm to gdb3 and flameshot stopped working

x@desktop:~$ flameshot gui
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.xcb: could not connect to display wayland-0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)
thw@thw-desktop:~$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Updates: A lot of software stopped working on wayland so I switched back to gnome and flameshot works fine.

Elite-zx commented 1 year ago

I have totally same problem on ubuntu22.04, the button not work to me, command flameshot gui just show black screen

The method below work to me

Go to /etc/gdm3/custom.conf Remove the comment on #WaylandEnable=false

source:Ubuntu 22.04. Flameshot not working

mmahmoudian commented 1 year ago

@Elite-zx You can use the gear icon in gdm (when you are typing your password to log into your computer) to choose X11. There is no need to manually edit the config file. Although we do not suggest using X11. Wayland is the future and it is also relatively safer. Yes, it is still in its infancy, but steadily Wayland will mature and so as Flameshot.

TheJazzDev commented 1 year ago

I have totally same problem on ubuntu22.04, the button not work to me, command flameshot gui just show black screen

The method below work to me

Go to /etc/gdm3/custom.conf Remove the comment on #WaylandEnable=false

source:Ubuntu 22.04. Flameshot not working

This is not a viable solution mate. It will just disable ubuntu wayland from your system and default to ubuntu on Xorg which is not what i want.

Akshaychdev commented 9 months ago

Facing the issue on Ubuntu 23.04 image

When changing to wayland by commenting WaylandEnable=false in /etc/gdm3/custom.conf in, Flameshot stops working with Unable to capture error

I have all these packages installed

Does any working solution to make flameshot working with wayland

kevint324 commented 9 months ago

I stopped searching for such solution after another tons of software stopped working on wayland. @Akshaychdev

mendhak commented 8 months ago

Not sure if helpful, but might be worth to mention that over in 4895 the dev team is forwarding complaints to flatpak/xdg-desktop-portal#649

There's supposedly a fix for this now in xdg-desktop-portal, see this comment and this pull request.

The short of it is, we should see the whitelisting behaviour in Gnome 43+ which is in Ubuntu 22.10 or for LTS, Ubuntu 24.04.

I am not confident enough to take the risk of forcefully upgrading to Gnome 43 on Ubuntu 22.04.

johnatanbrayan commented 7 months ago

For me it worked by creating a shortcut to run flameshot. In shortcut command, just run flameshot gui.

image

Bhagavan-Bollina commented 6 months ago

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

  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 :)
ccoVeille commented 6 months ago

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

  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

This would work. But I would like everyone to understand what it does.

flameshot has currently some issues when Wayland is enabled.

Here the change you are suggesting, that works, is about totally disable Wayland in your session.

It will have consequences on all your applications. And may lead to other issues. But yes, flameshot is likely to work.

laoshaw commented 6 months ago

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

  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

This would work. But I would like everyone to understand what it does.

flameshot has currently some issues when Wayland is enabled.

Here the change you are suggesting, that works, is about totally disable Wayland in your session.

It will have consequences on all your applications. And may lead to other issues. But yes, flameshot is likely to work.

that's correct, it's a workaround, not a fix.