Comment 17 for bug 823199

Revision history for this message
Magnes (magnesus2) wrote :

@Sebastian - I thought it was obvious - the solution Aleksi-ajp wrote is the only reasonable.

I peaked into the source code and: the change probably needs to be in Launcher.cpp in unity/plugins/unityshell/src/Launcher.cpp in function ProcessDndMove. Lack of comments in the code makes it hard to read, but I think makers of this part didn't anticipate such behaviour so it won't be simple. This code needs to be changed though:

 else
  {
    if (!_drag_edge_touching && hovered_icon != _dnd_hovered_icon)
    {
      if (hovered_icon)
      {
        hovered_icon->SendDndEnter();
        _drag_action = hovered_icon->QueryAcceptDrop(_dnd_data);
      }
      else
      {
        _drag_action = nux::DNDACTION_NONE;
      }

      if (_dnd_hovered_icon)
        _dnd_hovered_icon->SendDndLeave();

      _dnd_hovered_icon = hovered_icon;
    }
  }

  bool accept;
  if (_drag_action != nux::DNDACTION_NONE)
    accept = true;
  else
    accept = false;

  SendDndStatus(accept, _drag_action, nux::Geometry(x, y, 1, 1));

Quick but dirty solution would probably be changing

 hovered_icon->SendDndEnter();
        _drag_action = hovered_icon->QueryAcceptDrop(_dnd_data);

to:

 hovered_icon->SendDndEnter();
  _drag_action = nux::DNDACTION_COPY;

Or maybe changing accept to always true (there is no information what those mean, so someone who wrote this needs to correct this) - Jason Smith <email address hidden> is written as author, so maybe him? Should I contact him? Is it OK?