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

Flameshot doesn't work on Ubuntu 22.04: Use QT_QPA_PLATFORM=wayland #2199

Open
Valeryan24 opened this issue Dec 28, 2021 · 24 comments
Open

Flameshot doesn't work on Ubuntu 22.04: Use QT_QPA_PLATFORM=wayland #2199

Valeryan24 opened this issue Dec 28, 2021 · 24 comments
Labels
Unconfirmed Bug The bug is not confirmed by anyone else.

Comments

@Valeryan24
Copy link

Flameshot Version

Flameshot 0.10.2

Installation Type

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

Operating System type and version

Ubuntu 22.04 development

Description

Hi, thanks for this wonderful soft and all the work done. Sorry if the issue is linked to another one already opened, like #2107 :

I just upgraded to Ubuntu 22.04 development branch, and Flameshot doesn't work anymore. I well have the indicator on the top Gnome Shell panel, but trying to run a screenshot does nothing - no black window with resizing borders appears.

If I try to run from terminal, I get the error message :

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

I don't know what it means and how to set up QT_QPA_PLATFORM=wayland. I well have gambas3-gb-qt5-wayland and qtwayland5 installed, but on the login screen I only have 3 choices : Gnome, Ubuntu Wayland or X-Org.

Other users have the same issue, and the same happens with Ksnip - so it's certainly a problem due to Wayland security restrictions, and not a bug in Flameshot :
https://forum.ubuntu-fr.org/viewtopic.php?id=2068335

Steps to reproduce

Run flameshot on a Wayland session

Screenshots or screen recordings

No response

System Information

Ubuntu 22.04 on Wayland

@Valeryan24 Valeryan24 added the Unconfirmed Bug The bug is not confirmed by anyone else. label Dec 28, 2021
@borgmanJeremy
Copy link
Contributor

I was able to replicate this and then fix it. In a clean VM I saw this issues, then I installed: xdg-desktop-portal-gnome, and logged out and back in and it worked fine. This package is now required per #1910

I also installed bustle to debug any dbus issues, but i dont think this is what fixed it.

@Valeryan24
Copy link
Author

Thanks a lot, it works fine again !

It just adds a small step: when I run the screenshot, it does a capture of the entire screen, then I have to click on "Share", and it opens the normal Flameshot border selection, with all the options to save the image :)

@borgmanJeremy
Copy link
Contributor

Yes see #1910 for why that is the case, its out of our hands. @hosiet Do you think we should make these packages required dependencies in the .deb?

@mmahmoudian
Copy link
Member

mmahmoudian commented Dec 28, 2021

We should add this to our Wayland documentation I guess if it is reproducible on a clean VM. @borgmanJeremy and @hosiet if you two agree on this, I will assigned an issue to myself to do it.

@borgmanJeremy
Copy link
Contributor

It for sure is a requirement for gnome 41+ on wayland. The open question is if we should list it in the .deb file also.

@hosiet
Copy link
Member

hosiet commented Dec 28, 2021

Please do so. Also note that xdg-desktop-portal-gnome is only for GNOME. For other Wayland-enabled desktop environment, they may need xdg-desktop-portal-gtk or xdg-desktop-portal-kde or xdg-desktop-portal-wlr for different DEs respectively.

@borgmanJeremy
Copy link
Contributor

@hosiet is it possible to write the control file to be specific to the DE?

@hosiet
Copy link
Member

hosiet commented Dec 28, 2021

I don't have opinions for upstream-provides debs. For distribution-provided packages, we already have this:

https://sources.debian.org/src/flameshot/0.10.2+ds1-4/debian/control/

Recommends:
 xdg-desktop-portal-gtk | xdg-desktop-portal-gnome | xdg-desktop-portal-kde | xdg-desktop-portal-wlr,

Probably you may also use such format; it may have advantages and disadvantages. I don't have an ideal solution.

@hosiet
Copy link
Member

hosiet commented Dec 28, 2021

Just FYI: conditional-depends (install A if B has been installed) is not supported in all known dependency resolvers since that will introduce unacceptable level of complexity.

@xvitaly
Copy link
Contributor

xvitaly commented Dec 28, 2021

Added to Fedora:

Requires: xdg-desktop-portal%{?_isa}
Requires: (xdg-desktop-portal-gnome%{?_isa} if gnome-shell%{?_isa})
Requires: (xdg-desktop-portal-kde%{?_isa} if plasma-workspace%{?_isa})

Should be fixed now.

@xvitaly
Copy link
Contributor

xvitaly commented Dec 28, 2021

Just FYI: conditional-depends (install A if B has been installed) is not supported in all known dependency resolvers since that will introduce unacceptable level of complexity.

RPM supports this since version 4.13: https://rpm-software-management.github.io/rpm/manual/boolean_dependencies.html

@hosiet
Copy link
Member

hosiet commented Dec 28, 2021

RPM supports this since version 4.13: https://rpm-software-management.github.io/rpm/manual/boolean_dependencies.html

Thanks for the info. In Debian, the gnome-core package already has a hard dependency on xdg-desktop-portal-gnome. I am not sure if future Ubuntu (22.04 LTS) would also do the same.

@wgorski
Copy link

wgorski commented Dec 28, 2021

It just adds a small step: when I run the screenshot, it does a capture of the entire screen, then I have to click on "Share", and it opens the normal Flameshot border selection, with all the options to save the image :)

Same thing here. Is this the expected behaviour?

@borgmanJeremy
Copy link
Contributor

Read the link, yes, it's gnomes decision

@avramukk

This comment was marked as off-topic.

@mmahmoudian
Copy link
Member

@avramukk The problem you have is with Gnome and not Flameshot. Take your complaints to them. More information here:
https://flameshot.org/docs/guide/wayland-help/#gnome

I'll hide your message as it if off-topic

@Dylan-86

This comment was marked as off-topic.

@borgmanJeremy
Copy link
Contributor

@mmahmoudian I think we should program a bot to answer that question lol.

@Dylan-86 that share button is a change gnome made upstream and we have no control over it. Sorry for the small sarcasm, I think we are averaging that question twice a day.

@mmahmoudian
Copy link
Member

@Dylan-86 please read this:

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

@borgmanJeremy I'll pay 200€ for that bot if it answers that question every time and hide the question or close the issue. I bet Emacs has a package for that 😂

@Dylan-86
Copy link

Dylan-86 commented May 4, 2022

@Dylan-86 please read this:

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

@borgmanJeremy I'll pay 200€ for that bot if it answers that question every time and hide the question or close the issue. I bet Emacs has a package for that 😂

Thanks!!
And sorry for the complain, I got it was a gnome thing but thought that there was a workaround :(

Thanks!

@borgmanJeremy
Copy link
Contributor

I've been using gnome on xorg as a workaround but mainly use kde

@shun1249844726

This comment was marked as duplicate.

@Asgoret
Copy link

Asgoret commented Feb 10, 2023

Same here. xdg-desktop-portal-gnome doesn't help

UPD#1: Reinstall doesn't help

@lgrn
Copy link

lgrn commented Jun 12, 2024

╰─ flameshot --version
Flameshot v12.1.0 (-)
Compiled with Qt 5.15.10
╰─ cat /etc/lsb-release
DISTRIB_ID="ManjaroLinux"
DISTRIB_RELEASE="24.0.1"
DISTRIB_CODENAME="Wynsdey"
DISTRIB_DESCRIPTION="Manjaro Linux"
╰─ sudo pacman -Q xdg-desktop-portal-gnome
xdg-desktop-portal-gnome 46.2-1
╰─ echo $XDG_SESSION_TYPE
wayland

Unfortunately, I still got:

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

After googling a bit and finding this, I realized that if I run flameshot gui it works fine, so just putting that here in case anyone else ends up here from googling.

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.
Projects
None yet
Development

No branches or pull requests