GNU bug report logs - #30929
26.0.91; [macOS] Text drag and drop does not work

Previous Next

Package: emacs;

Reported by: Nick Helm <nick <at> tenpoint.co.nz>

Date: Sat, 24 Mar 2018 20:00:02 UTC

Severity: normal

Found in version 26.0.91

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nick Helm <nick <at> tenpoint.co.nz>
To: Alan Third <alan <at> idiocy.org>
Cc: 30929 <at> debbugs.gnu.org
Subject: bug#30929: 26.0.91; Text drag and drop does not work
Date: Sat, 28 Apr 2018 21:57:40 +1200
On Fri, 27 Apr 2018 at 08:44:42 +1200, Alan Third wrote:

> On Thu, Apr 26, 2018 at 11:16:32AM +1200, Nick Helm wrote:
>> 
>> My main problem is the bewildering number of different data types that
>> have be to handled, in particular casting every possibility from 
>> ObjC -> C -> Lisp and interpreting them at the end.
>
> When we pass the data to lisp we *always* want it in plain
> text, so if it’s a file then the filepath, a URL is plaintext anyway,
> as is text.
>
> Anything else we can ignore or reject.

OK, this is helpful. I was thinking we'd need to handle all the uniform
type identifiers. For example, yes a NSURLPboardType is always text but
it might conform to public.text, public.plain-text,
public.utf8-plain-text, public.url, public.file-url, etc. But I guess
Emacs couldn't care less about all that. The current code simply
converts to a UTF8 string and sends it on, so I'll do that too.

>> I'd planned to highlight the target Emacs window with a border to
>> give the user better feedback about the drop location
>
> Do you need to use ns_focus and ns_unfocus? These select and unselect
> an NSRect you want to update. If you search through nsterm.m for
> ns_focus you’ll be able to find other places where we draw to the
> frame.

Thanks, I'll give that a try.

>> As far as I can tell, Emacs on free platforms doesn't support being the
>> dragging source (either to other apps or within Emacs itself), so
>> I didn't look at that option at all.
>
> If it works in GNUstep, and I think this must, then we’re home free as
> it counts as a Free platform.
>
>     http://wiki.gnustep.org/index.php/Drag_and_drop
>
> I’ve got a GNUstep build virtual machine, so I can make sure it all
> works OK.

If you could check and let me know, that would be great. I'll get the
destination stuff working properly first though.

> If you need any help, or don’t understand something, please feel free
> to ask.

Thanks, I really appreciate it.








This bug report was last modified 6 years and 129 days ago.

Previous Next


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