flameshot-org / flameshot

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

Flameshot on sway exists with "Screenshot aborted" using latest edd228b9 and Gentoo package #2965

Open sumdog opened 2 years ago

sumdog commented 2 years ago

Flameshot Version

Flameshot v12.1.0 (edd228b9) Compiled with Qt 5.15.5

Installation Type

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

Operating System type and version

Gentoo - amd64 stable

Description

Currently on sway on Gentoo. I tried both the version in Gentoo portage (v12.1.0) and compiling from the latest github default branch. I make sure to set the XDG_CURRENT_DESKTOP=sway environment variable as well. I get the same error with both:

env XDG_CURRENT_DESKTOP=sway ./src/flameshot --version
Flameshot v12.1.0 (edd228b9)
Compiled with Qt 5.15.5

(gcc v11.3.0)

Steps to reproduce

No response

Screenshots or screen recordings

No response

System Information

Gentoo / Sway / amd64

strace from git compiled version attached.

strace-flameshot.log

mmahmoudian commented 2 years ago

Please make sure you have followed this documentation:

https://github.com/flameshot-org/flameshot/blob/master/docs/Sway%20and%20wlroots%20support.md

sumdog commented 2 years ago

I tried using the startup script that's listed and flameshot exited with the same error. I don't use systemd, but I do typically launch i3 using dbus-launch so I attempted to launch sway the same way:

#!/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
#exec sway
exec dbus-launch --sh-syntax --exit-with-session ssh-agent sway > ~/.sway-session.log 2>&1

For some reason, the variables are set in my shell except for XDG_CURRENT_DESKTOP which was set to kde instead of sway.

If I run dbus-update-activation-environment and then run env XDG_CURRENT_DESKTOP=sway flameshot full, flameshot just hangs. If I do an strace it hangs here:

statx(AT_FDCWD, "/home/cassius/.config/flameshot/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=822, ...}) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=3552, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=3552, ...}, 0) = 0
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=3552, ...}, 0) = 0
access("/home/cassius/.config/flameshot.ini", F_OK) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/cassius/.config/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffc7d9344e0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/cassius/.config/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffc7d934480) = -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, 0x7ffc7d9344e0) = -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, 0x7ffc7d934480) = -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, 0x7ffc7d9344e0) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/etc/xdg/flameshot.ini", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, 0x7ffc7d934480) = -1 ENOENT (No such file or directory)
statx(AT_FDCWD, "/tmp", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=STATX_ATTR_MOUNT_ROOT, stx_mode=S_IFDIR|S_ISVTX|0777, stx_size=320, ...}) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x561bfbbc7b50, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x561bfbbc7b00, FUTEX_WAKE_PRIVATE, 1) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7fdf33c7bc38, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7ffc7d934418, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x561bfbd961b0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x561bfbd96160, FUTEX_WAKE_PRIVATE, 1) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7fdf33c7bc38, FUTEX_WAKE_PRIVATE, 1) = 1
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x561bfbc6c7f0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x561bfbc6c7a0, FUTEX_WAKE_PRIVATE, 1) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7fdf33c7bc38, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7ffc7d934448, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x561bfbbec610, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x561bfbbec5c0, FUTEX_WAKE_PRIVATE, 1) = 0
poll([{fd=3, events=POLLIN}, {fd=11, events=POLLIN}], 2, 0) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\0\0\0\0\0\0\0", 16)         = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(3, "\1\0\0\0\0\0\0\0", 8)         = 8
poll([{fd=3, events=POLLIN}, {fd=11, events=POLLIN}], 2, 0) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\1\0\0\0\0\0\0\0", 16)         = 8
poll([{fd=3, events=POLLIN}, {fd=11, events=POLLIN}], 2, -1) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
restart_syscall(<... resuming interrupted poll ...>) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
restart_syscall(<... resuming interrupted restart_syscall ...>) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
restart_syscall(<... resuming interrupted restart_syscall ...>
fuzunspm commented 1 year ago

same issue