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


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

From: Alan Third <alan <at> idiocy.org>
To: Nick Helm <nick <at> tenpoint.co.nz>
Cc: 30929 <at> debbugs.gnu.org
Subject: Re: bug#30929: 26.0.91; Text drag and drop does not work
Date: Sun, 25 Mar 2018 12:57:32 +0100
On Sun, Mar 25, 2018 at 01:28:11AM +1300, Nick Helm wrote:
> 
> On MacOS text drag-n-drop does not work out of the box. Also a dnd 
> event seems to be bound to different functions depending on modifier 
> settings.
> 
> Emacs -Q
> 
> C-h v ns-command-modifier -> "It's value is super"
> 
> C-h k <drag and drop external text> 
>   -> "<M-s-drag-n-drop> is undefined"
> 
> (setq ns-command-modifier 'none)
> C-h k <drag and drop external text>
>   -> "<M-drag-n-drop> at that spot runs the command
>       ns-drag-n-drop-as-text"
> 
> (setq ns-command-modifier 'control)
> C-h k <drag and drop external text>
>   -> "<C-M-drag-n-drop> at that spot runs the command
>       ns-drag-n-drop-as-text-other-frame"

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. I’ll
have to read up on it and have a think to see if I can work out a
solution.
-- 
Alan Third




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.