aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsselect.m
diff options
context:
space:
mode:
authorPo Lu2022-06-04 16:19:01 +0800
committerPo Lu2022-06-04 16:19:01 +0800
commiteffbd2aeef3d6ec3d09d40ff095e072b2d9834d4 (patch)
treec1e9b43ffd0477923fc695e519833fd1748ba9b0 /src/nsselect.m
parent2ce686c049a7a35cdc3eb87626d8a94539388a35 (diff)
downloademacs-effbd2aeef3d6ec3d09d40ff095e072b2d9834d4.tar.gz
emacs-effbd2aeef3d6ec3d09d40ff095e072b2d9834d4.zip
Fix file drag-and-drop on GNUstep
* src/nsselect.m (ns_decode_data_to_pasteboard): Convert URL to path names when we're using NSFilenamesPboardType. * src/nsterm.m: ([EmacsView performDragOperation:]): Handle cases where plist is a string.
Diffstat (limited to 'src/nsselect.m')
-rw-r--r--src/nsselect.m10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nsselect.m b/src/nsselect.m
index a719eef4e86..6831090aa20 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -565,6 +565,9 @@ ns_decode_data_to_pasteboard (Lisp_Object type, Lisp_Object data,
565 NSMutableArray *temp; 565 NSMutableArray *temp;
566 Lisp_Object tem; 566 Lisp_Object tem;
567 specpdl_ref count; 567 specpdl_ref count;
568#if !NS_USE_NSPasteboardTypeFileURL
569 NSURL *url;
570#endif
568 571
569 types = [pasteboard types]; 572 types = [pasteboard types];
570 count = SPECPDL_INDEX (); 573 count = SPECPDL_INDEX ();
@@ -602,7 +605,12 @@ ns_decode_data_to_pasteboard (Lisp_Object type, Lisp_Object data,
602 [pasteboard setString: [NSString stringWithLispString: data] 605 [pasteboard setString: [NSString stringWithLispString: data]
603 forType: NSPasteboardTypeFileURL]; 606 forType: NSPasteboardTypeFileURL];
604#else 607#else
605 [pasteboard setString: [NSString stringWithLispString: data] 608 url = [NSURL URLWithString: [NSString stringWithLispString: data]];
609
610 if (!url)
611 signal_error ("Invalid file URL", data);
612
613 [pasteboard setString: [url path]
606 forType: NSFilenamesPboardType]; 614 forType: NSFilenamesPboardType];
607#endif 615#endif
608 } 616 }