User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080325 Ubuntu/7.10 (gutsy) Firefox/2.0.0.13 Build Identifier: When I drag a file over a folder using the right mouse button, Thunar normally shows a question mark over the cursor, and then opens a context menu when I drop the file. This menu is very helpful, allowing me to choose whether to copy, move, link, or extract the file into the target directory. This functionality is missing when dragging files to or from the desktop. I cannot right-drag files from the desktop at all, which is inconsistent at best. I can right-drag files to the desktop, and Thunar does show the question mark cursor as expected, but it unilaterally performs a file copy instead of showing the context menu. Every time it does this, I feel like I have been tricked by the UI. Reproducible: Always Steps to Reproduce: 1. Choose "Allow Xfce to manage the desktop" and "File/launcher icons" in the Xfce Desktop Preferences. 2. Drag a file from a Thunar window to the desktop using the right mouse button. 3. Try dragging a file from the desktop to a Thunar window using the right mouse button. Actual Results: In step 2, the file is copied to the desktop without prompting the user. In step 3, the file cannot be dragged at all. Expected Results: In step 2, dropping the file on the desktop should prompt the user for which operation (copy/move/link/etc.) to perform, just as when dropping a file on a Thunar directory window. In step 3, the file should be draggable, just as when dragging a file from a Thunar directory window.
Created attachment 3982 [Patch] Enables xfdesktop to move or copy files from other applications to the desktop. So far I've only tested with Thunar and it only does copy or move (no link yet). This took a bit of work so hopefully someone can QA/test it and let me know if there's any issues.
Created attachment 3984 This adds the "Link Here" option to the dnd menu when doing a right click & drag from another application. This extends the previous patch to add the link here functionality. You can also copy from the desktop to applications with Thunar but the pop-up context menu doesn't happen just yet.
Created attachment 3999 Adds support for the right click drag and drop when moving files to and from the desktop. Fixes bug 4004 This patch should be complete. You can drag and drop files to and from the desktop and the menu should pop-up if the application supports the GDK_ACTION_ASK (most don't seem to).
Created attachment 4026 [PATCH] Adds support for the right click drag and drop when moving Found a cosmetic bug in the last patch where a cancel operation wouldn't call drag_finish. While fixing that I cleaned up some of the code a little and made it simpler. This patch supersedes the previous patches.
Created attachment 4029 [Patch] Right click drag and drop to and from xfdesktop. Found a bug in the last patch. This should be correct and complete now.
Created attachment 4098 [PATCH] Drag and drop fixes (right click menu & copy instead of move) You can drag and drop files to and from the desktop and the menu will pop-up. Additionally, this patch also fixes the issue where files that were dropped onto the desktop were always copied by default instead of doing a move when they were on the same filesystem. They were combined because the move/copy bug requires code implemented in this right click drag and drop patch. Fixes bugs 4004 and 2644.
gtk_image_menu_item_new_with_mnemonic() still needs _() around action_names[menu_item] for gettext. gtk_menu_set_screen is useless like this, use the drop_icon if needed. You can use G_FILE_ATTRIBUTE_ID_FILESYSTEM. g_file_query_info can return NULL, so you need to check that, else the app will crash/error on g_object_unref. You can also use g_file_info_get_attribute_string, since id:filesystem is a string type, avoids copying and freeing.
Created attachment 4155 [PATCH] Right-click Drag and Drop Added the _() in gtk_image_menu_item_new_with_mnemonic() for gettext. Changed to use G_FILE_ATTRIBUTE_ID_FILESYSTEM. Check g_file_query_info for NULL. Switched to g_file_info_get_attribute_string. Dropped the call to gtk_menu_set_screen. Thanks!
The values of dest_name and src_name are better of in if(dest_info != NULL && src_info != NULL)
Created attachment 4165 [PATCH] Right-click Drag and Drop Fixed. Now it checks if the names are not NULL. Thanks.
g_strcmp0 can handle NULL file (it's in the name), but you should check the object send to g_file_info_get_attribute_string.
Created attachment 4166 [PATCH] Right-click Drag and Drop Oh right... I'm an idiot. Should be fixed now.