Drag&drop from other apps - default event action gets ignored

I want to set the default action from external drag&drop to an Opus window to Copy. However, this doesn't seem to work. I made the steps as written in the manual: setting the drag-and-drop event to "Copy" in "All files & folders" type. However, this is ignored - whenever I drag files in an Opus lister, the action is "Move".

Is there something else that affects this setting?

Are you dragging normal files from the other apps, or are they something else (e.g. in-memory virtual files, files inside archives, from internet servers, etc.)?

Normal files from other (file manager) apps. Hovering them to DO displays the "Move to X" tooltip.

I can't reproduce that. If I set that event to Copy and then drag a file from File Explorer to Opus, the tooltip says Copy.

(Other programs may override the default or available drag & drop actions.)

Other programs may override the default or available drag & drop actions

It also works for me in Explorer, but there are some other programs where manual explicitly says this is controlled by drag target, and it seemingly isn't (eg. WinSCP). I will research on their side then.

@Leo I followed up a bit on this, and there maybe is an underlying problem here still. Is it possible that the above is because DO doesn't handle/expose CF_PREFERREDDROPEFFECT adequately?
For some more detail:

Opus checks for CF_PREFERREDDROPEFFECT in some situations, but it can also be overridden, since your Opus config is what decides what happens when files are dropped on Opus.

(And it is, after all, only a preferred action, which can be overridden. There is a separate thing which sets the allowed actions, where Move can be removed as an option entirely if it doesn't make sense.)

If your default drag & drop action in Opus is set to Copy (instead of the Copy MOVEWHENSAME default) but drops from WinSCP result in a move then it's unlikely CF_PREFERREDDROPEFFECT is the issue, as Opus would already be defaulting to copy as the action. With that configuration, I'd expect it to only change from copy to move if copy was not included in the allowed actions but move was.

1 Like

My default actions are set to nothing on every event (on all files, all folders, files&folders). Does this make them overriddenable? Is there a way for explicitly setting nothing?

Explicitly setting nothing as the event would mean nothing happened on drag & drop (not copy, or move, or link, but nothing at all), which I don't think is the aim here.

(It's possible we have code to detect that and apply defaults to avoid nothing at all happening. I've never tested such a configuration.)

It also seems different to what you said at the start of the thread:

Sorry about the confusion - the aim since indeed is for nothing to happen (for the first drag-and-drop event, without modifier keys)

I did a quick test with WinSCP and the default Copy MOVEWHENSAME in Opus results in a Copy by default, as you'd expect.

Changing it to Copy MOVE results in a move by default, which I think is correct. (I guess we could have a Copy MOVEUNLESSNOTPREFERRED or something to make it not override the preferred action. It gets quite complicated, though.)

One thing I noticed which would cause confusion is the drag cursor indicates a copy will happen when no key is held down, even when it's going to do a move. That doesn't happen when dragging from File Explorer to Opus, so I think that may be down to the source of the drag and not something Opus is doing. (It also looks like WinSCP is using the old/basic drag & drop system, not the newer IDragSourceHelper which adds nicer overlays and better feedback; if they switch to the newer system then it might start indicating the action correctly for free, removing the surprise when it does a move instead of a copy.)

I just checked and deleting the event entirely should work for that, or at least does here. (As long as there's no similar event on other filetypes that match what's being dragged.) You should get a "blocked" cursor when there's no drag & drop event.