GNU bug report logs - #43470
27.1; Drag and Drop not working properly in 27.1 on OSX

Previous Next

Package: emacs;

Reported by: "Paul Magwene, Ph.D." <paul.magwene <at> duke.edu>

Date: Thu, 17 Sep 2020 16:43:02 UTC

Severity: normal

Found in version 27.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 43470 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Alan Third <alan <at> idiocy.org>
Cc: "Paul Magwene, Ph.D." <paul.magwene <at> duke.edu>, 43470 <at> debbugs.gnu.org
Subject: Re: bug#43470: 27.1; Drag and Drop not working properly in 27.1 on OSX
Date: Thu, 17 Sep 2020 20:12:56 +0200
Alan Third <alan <at> idiocy.org> writes:
>
> Confirmed.
>
> Annoyingly I could've sworn this worked just a few months ago. I
> wonder if Apple have changed something in their libraries to
> completely deprecate the old methods.
>
> Anyway, It'll need to be almost completely rewritten (again!).

Hi, Alan:

Could it be caused by an incomplete rename done at
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9624f609493da7c08016ba00d6895bad0fe26a0e?

The following patch fixes the reported bug for me on 10.15.6 and Emacs
28.0.50, and also fixes some compilation warnings as well:

diff --git a/src/nsterm.m b/src/nsterm.m
index 26059ab67c..c40f790e0f 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5648,7 +5648,7 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes.
   ns_drag_types = [[NSArray arrayWithObjects:
                             NSPasteboardTypeString,
                             NSPasteboardTypeTabularText,
-                            NSFilenamesPboardType,
+                            NSPasteboardTypeFileURL,
                             NSPasteboardTypeURL, nil] retain];
 
   /* If fullscreen is in init/default-frame-alist, focus isn't set
@@ -8592,10 +8592,7 @@ -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender
     {
       return NO;
     }
-  /* FIXME: NSFilenamesPboardType is deprecated in 10.14, but the
-     NSURL method can only handle one file at a time.  Stick with the
-     existing code at the moment.  */
-  else if ([type isEqualToString: NSFilenamesPboardType])
+  else if ([type isEqualToString: NSPasteboardTypeFileURL])
     {
       NSArray *files;
       NSEnumerator *fenum;
@@ -8610,7 +8607,7 @@ -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender
       while ( (file = [fenum nextObject]) )
         strings = Fcons ([file lispString], strings);
     }
-  else if ([type isEqualToString: NSURLPboardType])
+  else if ([type isEqualToString: NSPasteboardTypeURL])
     {
       NSURL *url = [NSURL URLFromPasteboard: pb];
       if (url == nil) return NO;
@@ -8619,8 +8616,8 @@ -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender
 
       strings = list1 ([[url absoluteString] lispString]);
     }
-  else if ([type isEqualToString: NSStringPboardType]
-           || [type isEqualToString: NSTabularTextPboardType])
+  else if ([type isEqualToString: NSPasteboardTypeString]
+           || [type isEqualToString: NSPasteboardTypeTabularText])
     {
       NSString *data;
 




This bug report was last modified 4 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.