flameshot-org / flameshot

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

Flameshot will not launch in wayland (specifically the "river" compositor. #2151

Open Spagett1 opened 2 years ago

Spagett1 commented 2 years ago

Flameshot Version

flameshot-0.10.2-1

Installation Type

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

Operating System type and version

Artix Linux

Description

When trying to run flameshot gui nothing will happen. i have taken a look at https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist and https://github.com/flameshot-org/flameshot/blob/master/docs/Sway%20and%20wlroots%20support.md however the steps do not work,

I have added the following lines to my river init

riverctl float-filter-add "flameshot"

exec hash dbus-update-activation-environment 2>/dev/null && \
           dbus-update-activation-environment DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY
XDG_CURRENT_DESKTOP=sway

and the script that launches river contains the following

#!/usr/bin/bash
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
XDG_CURRENT_DESKTOP=sway dbus-run-session river

this successfully starts river and running echo $XDG_CURRENT_DESKTOP returns with sway, as the distro does not use systemd i have also added pipewire and pipewire-pulse to the autostart aswell as adding the file ~/xdg-desktop-portal-wlr containing

[screencast]
output_name=eDP-1
max_fps=60
chooser_cmd=slurp -f %o -or
chooser_type=simple

however i believe the troubleshooting guide had more so screensharing and recording in mind for that section.

Steps to reproduce

  1. Set environment variables
  2. Launch river
  3. Launch flameshot gui
  4. Issue occurs here

Screenshots or screen recordings

as you can see in this photo flameshot will just hang and do nothing when run 20211210_01h01m13s_grim

System Information

Artix Linux (rolling release) 60hz 1080p monitor WM=river Wayland OpenRc, not systemd

mmahmoudian commented 2 years ago

Would you please try installing from AUR as it compiles from master branch of this repo which has more bug fixes for Wayland. Please let us know how it goes.

Spagett1 commented 2 years ago

ive compiled the latest version from the aur, ive also gone back to base arch and have added the following lines to my autostart

exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY

running flameshot gui still just hangs, however running flameshot by itself returns

QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)

and then just hangs

inga-lovinde commented 2 years ago

Can confirm that the bug is still here. flameshot gui hangs doing nothing, flameshot adds its icon to tray but "Take screenshot" or "Open launcher" do nothing. Screensharing in Firefox and Chrome work fine, implying that xdg-desktop-portal-wlr is configured properly. wayshot works without any problems. XDG_CURRENT_DESKTOP is set to "sway".

That's on Alpine edge, with latest flameshot from packages ("Flameshot v12.1.0 (c11df46807) Compiled with Qt 5.15.5"), and latest river (0.1.3-r3), latest xdg-desktop-portal-wlr (0.6.0-r0), and latest wlroots (0.15.1-r2), on x86-64.

ThatOneCalculator commented 2 years ago

Yep, just seems there's no implementation for wlroots.

afrischk commented 2 years ago

Can confirm. Same for me on Arch with Sway and Wayland.

agentzhao commented 1 year ago

QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)

Getting the same error with sway on Fedora

Would like to add that it was working before I did a full system update on all my packages

midirhee12 commented 3 months ago

3674 Might be related.