Opened 5 weeks ago

Last modified 5 weeks ago

#19368 new bug

During a in-app drag and drop, the Tracker ignores the drag message and only considers the selection of the source window

Reported by: Nexus-6 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Tracker Version:
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

When a file is dropped in-app, i.e. from one window to another (this also applies to the Desktop), the Tracker looks for the current selection in the source window and if the selection is empty it returns doing nothing. Worse still it does not even check if the selection matches with the refs and just picks up the selected file from the source window ignoring the actual refs in the message.

This leads to many side effects.

Scenario A

Take two Tracker windows side by side pointing to folderA and folderB, respectively. While dragging whatever element from windowA to windowB, close the former with the shortcut CMD-W. Now that it’s gone, keep dragging and drop the file onto the destination window and the Tracker will… do nothing.

Scenario B If the selection is changed “in-flight” with the arrow keys the new currently selected element is moved to the destination.

For a more comprehensive context, see this post https://discuss.haiku-os.org/t/drag-a-message-with-a-designated-bmessenger-aka-codename-dropit/15933/21.

Change History (4)

comment:1 by waddlesplash, 5 weeks ago

Component: - GeneralApplications/Tracker

comment:2 by jscipione, 5 weeks ago

I can point you in the right direction. Drag and drop is handled in BPoseView clas, specifically BPoseView::MoveSelectionInto() near the bottom where it says okToMove. The setup is done above in BPoseView::HandleDropCommon() which has the drop message. It ignores the refs from the drop message except in a “foreign drag” otherwise it gets the pose list from the source window like you said.

comment:3 by Nexus-6, 5 weeks ago

Thanks! I already looked at the code but the question is why is it implemented this way?

PS: I have built a debug version of the Tracker and libbe and libtracker but the Debugger sees all the files except PoseView.cpp. Any idea why?

comment:4 by jscipione, 5 weeks ago

It has always been this way, at least since the days of OpenTracker. I cannot tell you why it is done this way other than that's how they did it, presumably at Be, and it may not be the most optimal way to do it. You'll have to write a new method that reads the dropped refs or update the existing MoveSelectionTo() method to do so.

ToDo: pick files to drop/launch on a case by case basis

https://github.com/HaikuArchives/OpenTracker/blob/master/opentracker/tracker/PoseView.cpp#L4229C3-L4230C55

Note: See TracTickets for help on using tickets.