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

No screenshot mode starts on Sway #3464

Open emilyyyylime opened 10 months ago

emilyyyylime commented 10 months ago

Flameshot Version

Flameshot v12.1.0 (-) Compiled with Qt 5.15.10

Installation Type

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

Operating System type and version

Arch linux (6.6.8-arch1-1)

Description

flameshot gui hangs without any signs of something happening, right- or left-clicking the tray icon does nothing, only way I could see the program do anything was flameshot config. xdg-desktop-portal-wlr is correctly installed and screen capture works in e.g. Firefox

Steps to reproduce

No response

Screenshots or screen recordings

No response

System Information

Arch Linux (6.6.8-arch1-1) Single builtin monitor Wayland, Sway from AUR swayfx package (sway version 0.3.2-26cdeeb (Dec 4 2023, branch 'master'))

link2xt commented 9 months ago

Same with river. Hangs forever.

Version:

$ flameshot -v
Flameshot v12.1.0 (-)
Compiled with Qt 5.15.10

When started as flameshot the only thing printed is:

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

Running under strace:

...
access("/home/user/.config/flameshot/flameshot.ini", F_OK) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/user/.config/flameshot/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad460) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/user/.config/flameshot/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad3f0) = -1 ENOENT (No such file or directory)
access("/home/user/.config/flameshot.ini", F_OK) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/user/.config/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad460) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/user/.config/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad3f0) = -1 ENOENT (No such file or directory)
access("/etc/xdg/flameshot/flameshot.ini", F_OK) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/etc/xdg/flameshot/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad460) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/etc/xdg/flameshot/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad3f0) = -1 ENOENT (No such file or directory)
access("/etc/xdg/flameshot.ini", F_OK)  = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/etc/xdg/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad460) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/etc/xdg/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffd29aad3f0) = -1 ENOENT (No such file or directory)
brk(0x55c177515000)                     = 0x55c177515000
poll([{fd=5, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=21, events=POLLIN}], 4, 86399446) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\1\0\0\0\0\0\0\0", 8)          = 8
poll([{fd=5, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=21, events=POLLIN}], 4, 86389991) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\1\0\0\0\0\0\0\0", 8)          = 8
poll([{fd=5, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}, {fd=21, events=POLLIN}], 4, 86379988) = 1 ([{fd=5, revents=POLLIN}])
read(5, "\1\0\0\0\0\0\0\0", 8)          = 8
link2xt commented 9 months ago

Backtrace from the master branch (3d21e4967b68e9ce80fb2238857aa1bf12c7b905):

(gdb) bt
#0  0x00007ffff6320f6f in poll () at /usr/lib/libc.so.6
#1  0x00007ffff516c2b6 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff510c162 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff6aead0c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#4  0x00007ffff6a9ac04 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff6a9c0a3 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#6  0x00005555555bd870 in main(int, char**) (argc=<optimized out>, argv=0x7fffffffe0b8) at /home/user/src/flameshot/src/main.cpp:161
link2xt commented 9 months ago

It actually created a tray icon, I had to add "tray" widget to waybar. So my issue is different.

link2xt commented 9 months ago

Actually I have started XDG_CURRENT_DESKTOP=Sway flameshot and GUI does not start, I only have a tray icon and nothing happens when I click on menu items.

naortega commented 9 months ago

I get this same issue when I run flameshot. If I do not manually specify XDG_CURRENT_DESKTOP=Sway before the flameshot command it gives me the following:

nicolas@pius-xi ~/ $ flameshot gui
flameshot: error: Unable to detect desktop environment (GNOME? KDE? Sway? ...)
flameshot: error: Hint: try setting the XDG_CURRENT_DESKTOP environment variable.
flameshot: error: Unable to capture screen
flameshot: error: Unable to capture screen
libEGL warning: egl: failed to create dri2 screen
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
flameshot: info: Screenshot aborted.

But when I specify it manually I get absolutely nothing. It just stalls in the commandline until I cancel it with Ctrl+C.

System: ArchLinux (6.7.4-zen1-1-zen) Sway version 1.8.1 Flameshot v12.1.0 (-) Compiled with Qt 5.15.10

Stack trace attached. strace-flameshot.txt

AndreasAZiegler commented 7 months ago

I have the same issue. I'm happy to provide further information if it helps the troubleshooting.