GNOME Bugzilla – Bug 335292
Drag-drop from file roller drops to the wrong place
Last modified: 2007-12-31 10:20:42 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/file-roller/+bug/33707 "Dragging files from file roller drops them to the wrong place. 1 Nautilus open in /home/user/downloads 2 There is a folder /home/user/downloads/stuff visible 3 Open the file /home/user/downloads/text.zip which contains a small text file. 4 Drag the text file to the 'stuff' folder icon. It looks like the file will be dropped there. 5. Let go of the button. Expected result: The file is extracted into /home/user/downloads/stuff Acual result: The file is extracted into /home/user/downloads This doesn't seem to be the same problesm as Bug #13199 since this is a small file and is successfully extracted. It's as if the drop target was wrongly given as the nautilus current directory, rather than the sub directory you really dragged to."
I can confirm this. This seems to be more of a gnome/nautlus problem than file-roller. It seems that the folder to which the file is being dragged is not recieving the focus at all, instead the main nautilus window gets the focus and that is the where the file is dropped instead of the intended folder. I haven't checked but file-roller would get the focus window from gnome/nautlus and simply extract the file there. If it gets a wrong directory name, so be it, it'll extract the file to the *wrong* directory.
The bug is in Nautilus - the function that deals with mutliple URIs being dropped eventually just gets the main view pane and adds the dropped files there. I've written a patch for it in Nautilus - but I don't know if it's possible to change this bug to "product: nautilus" or should I open a new bug with that status?
changing the product is possible, reassign to nautilus now
Created attachment 70154 [details] [review] nautilus patch for dnd to sub folder This patch changes nautilus-tree-view-drag-dest.c in the function receive_dropped_uri_list. It reuses the receive_uris function, which gets the actual path in the tree dropped to and moves the files there. It makes no difference in icon mode (I don't think that has an easy solution since focus is not passed to the sub folders at all there). The real problem for tree view mode is in src/file-manager/fm-directory-view.c in fm_directory_view_handle_uri_list_drop. This function has no way to know about the path in the tree that was dropped to - or at least not without exposing a lot of the functions already in nautilus-tree-view-drag-dest.c. It just gets the container directory and drops the files there. An alternative fix would be to use gtk_tree_view_get_dest_row_at_pos to get the path dropped-to using get_drop_path and get_drop_target from nautilus-tree-view-drag-dest.c, but in the fm_directory_view_handle_uri_list_drop function. That would require more changes, making the 2 static functions mentioned in nautilus-tree-view-drag-dest.c non static and exporting them in header files or similar.
Created attachment 88733 [details] [review] patch in text/plain Seems the patch that Richard Quirk uploaded was .gz
Created attachment 88735 [details] [review] This time for real.
Sorry.
I can't reproduce this bug with latest (2.21.1) version of Nautilus...dragging a file from file-roller to a folder in a Nautilus window, saves the file in the right place. I'm closing this bug as OBSOLETE. Feel free to reopen the bug, or open a new one if the problem still occurs. Thanks!