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: Wed, 28 Mar 2018 22:20:13 +1300
[Message part 1 (text/plain, inline)]
Hi Alan,

On Sun, 25 Mar 2018 at 12:57:32 +0100, Alan Third wrote:

> Looks like this is how the modifiers are set in performDragOperation
>
>   if (! (op & (NSDragOperationMove|NSDragOperationDelete)) &&
>       // URL drags contain all operations (0xf), don't allow all to be set.
>       (op & 0xf) != 0xf)
>     {
>       if (op & NSDragOperationLink)
>         modifiers |= NSEventModifierFlagControl;
>       if (op & NSDragOperationCopy)
>         modifiers |= NSEventModifierFlagOption;
>       if (op & NSDragOperationGeneric)
>         modifiers |= NSEventModifierFlagCommand;
>     }
>
>   modifiers = EV_MODIFIERS2 (modifiers);
>
> It’s setting the actual modifier keys, so when a user changes those
> keys’ settings this breaks.
>
> You can also set these flags by using the actual modifier keys.
>
> This looks like it matches up with what Apple expect you to do, but it
> doesn’t seem to match up with Emacs’s event handling very well. 

That looks about right to me too, it least it matches the general
approach in the docs.

I had a go at mapping the hardware modifiers to Emacs events (and
existing bindings) for each drag type and DragOperation mask. Patch
attached. This doesn't support the ns-right-*-modifiers yet, but they
should be pretty easy to add if you want to go this way.

[0001-Improve-handling-of-drag-and-drop-modifiers-on-NS.patch (text/x-patch, attachment)]

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.