Commit 016b919
fix(macos): fix clipboard copy failing from tray and GUI (flameshot-org#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>1 parent c4db15c commit 016b919
2 files changed
+15
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 144 | | |
149 | | - | |
150 | 145 | | |
151 | 146 | | |
152 | 147 | | |
| |||
156 | 151 | | |
157 | 152 | | |
158 | 153 | | |
159 | | - | |
160 | 154 | | |
161 | | - | |
162 | 155 | | |
163 | 156 | | |
164 | 157 | | |
| |||
174 | 167 | | |
175 | 168 | | |
176 | 169 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | 170 | | |
182 | | - | |
183 | 171 | | |
184 | 172 | | |
185 | 173 | | |
186 | 174 | | |
187 | 175 | | |
188 | 176 | | |
189 | | - | |
190 | 177 | | |
191 | | - | |
192 | 178 | | |
193 | 179 | | |
194 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 114 | | |
154 | 115 | | |
155 | 116 | | |
| |||
169 | 130 | | |
170 | 131 | | |
171 | 132 | | |
172 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
173 | 141 | | |
174 | 142 | | |
175 | 143 | | |
| |||
205 | 173 | | |
206 | 174 | | |
207 | 175 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
211 | 181 | | |
| 182 | + | |
212 | 183 | | |
213 | | - | |
214 | 184 | | |
215 | | - | |
216 | 185 | | |
217 | 186 | | |
218 | 187 | | |
| |||
223 | 192 | | |
224 | 193 | | |
225 | 194 | | |
| 195 | + | |
226 | 196 | | |
227 | 197 | | |
228 | 198 | | |
| |||
0 commit comments