SIGN IN SIGN UP
flameshot-org / flameshot UNCLAIMED

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:

0 0 70 C++

fix: use runtime detection for Wayland clipboard (#4497)

When compiled with USE_WAYLAND_CLIPBOARD, the clipboard now works
correctly on both Wayland and X11 sessions.

Previously, builds with USE_WAYLAND_CLIPBOARD=ON would always use
KSystemClipboard, which doesn't work properly when running under X11
(e.g., via XWayland or QT_QPA_PLATFORM=xcb).

This change adds a runtime check for the platform name:
- 'wayland' -> uses KSystemClipboard (KF6 GuiAddons)
- otherwise -> uses QApplication::clipboard() (standard Qt)

This allows distros to ship a single binary that works on both
display servers without requiring separate builds.

Co-authored-by: Benigno Batista Júnior <benigno@opus-software.com.br>
B
Benigno Batista Júnior committed
c2cae0301bb850235f9b6efed86e5c4d33a8842b
Parent: 3ef8f09
Committed by GitHub <noreply@github.com> on 2/21/2026, 1:29:17 PM