aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Pluim2024-06-16 14:23:37 +0200
committerRobert Pluim2024-06-16 14:23:37 +0200
commit275a5582414c2f63bccce896200b4e84f1ba0d75 (patch)
treeb2f01e1b03d26f03d376ec908ad112da1ff059eb /src
parenta39f6480ea5b6d3f81db90808123cdeb54790787 (diff)
downloademacs-275a5582414c2f63bccce896200b4e84f1ba0d75.tar.gz
emacs-275a5582414c2f63bccce896200b4e84f1ba0d75.zip
Fix clipboard request on macOS for yank-media
'yank-media' makes a request with 'CLIPBOARD and 'TARGETS, which on other platforms returns the type(s) of the current selection, but on macOS returned the selection itself. Make it return the types instead. This fixes (Bug#71377). * src/nsselect.m (ns_get_local_selection): Return nil when called with QCLIPBOARD and QTARGETS, so that 'ns_get_foreign_selection' is called to return the type(s) of the selection.
Diffstat (limited to 'src')
-rw-r--r--src/nsselect.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nsselect.m b/src/nsselect.m
index bb6679cd2ab..be52609e21c 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -205,6 +205,14 @@ ns_get_local_selection (Lisp_Object selection_name,
205 Lisp_Object target_type) 205 Lisp_Object target_type)
206{ 206{
207 Lisp_Object local_value; 207 Lisp_Object local_value;
208 /* `yank-media' uses this combination to figure out what the
209 available types of the selection are. Return nil here so that
210 ns_get_foreign_selection ends up being called to do that
211 (Bug#71377). */
212 if (EQ (selection_name, QCLIPBOARD)
213 && EQ (target_type, QTARGETS))
214 return Qnil;
215
208 local_value = assq_no_quit (selection_name, Vselection_alist); 216 local_value = assq_no_quit (selection_name, Vselection_alist);
209 return local_value; 217 return local_value;
210} 218}