[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30929: 26.0.91; Text drag and drop does not work

From: Nick Helm
Subject: bug#30929: 26.0.91; Text drag and drop does not work
Date: Wed, 28 Mar 2018 22:20:13 +1300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (darwin)

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.

Attachment: 0001-Improve-handling-of-drag-and-drop-modifiers-on-NS.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]