SIGN IN SIGN UP
flameshot-org / flameshot UNCLAIMED

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

0 0 70 C++

fix(macos): fix clipboard copy failing from tray and GUI (#4629)

The clipboard copy from tray menu and capture GUI was broken on macOS:

1. FlameshotDaemon::copyToClipboard() created a KDSingleApplication
   instance and called isPrimaryInstance(), which always returned false
   (the daemon already holds the socket). This caused a 3-second IPC
   timeout before falling back. Fix: use instance() to check if the
   daemon singleton exists in-process, matching non-macOS behavior.

2. saveToClipboardMime() used setData("image/...") which puts a lazy
   reference on the macOS pasteboard. If the app exits before paste,
   data is lost ("Cannot keep promise"). Fix: use setImageData() for
   native pasteboard persistence, plus setData() for exact format.

3. saveJpegToClipboardMacOS() used osascript with a temp file and
   incorrectly labeled JPEG data as PNG UTI. Removed entirely — the
   fixed saveToClipboardMime() now handles both JPEG and PNG.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
V
Vladimir Mitnitsky committed
016b9197e88320eb42a7713265d1902aedf5a035
Parent: c4db15c
Committed by GitHub <noreply@github.com> on 4/12/2026, 1:07:44 PM