! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
right click drag and drop menu does not work on desktop
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfdesktop
Component:
General

Comments

Description Forest 2008-04-10 20:23:35 CEST
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.
Comment 1 Eric Koegel editbugs 2011-11-25 13:47:22 CET
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.
Comment 2 Eric Koegel editbugs 2011-11-26 08:50:53 CET
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.
Comment 3 Eric Koegel editbugs 2011-12-03 09:49:01 CET
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).
Comment 4 Eric Koegel editbugs 2011-12-16 07:11:03 CET
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.
Comment 5 Eric Koegel editbugs 2011-12-17 17:26:21 CET
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.
Comment 6 Eric Koegel editbugs 2012-01-13 05:56:22 CET
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.
Comment 7 Nick Schermer editbugs 2012-01-18 15:52:22 CET
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.
Comment 8 Eric Koegel editbugs 2012-01-30 13:22:46 CET
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!
Comment 9 Nick Schermer editbugs 2012-02-02 08:54:00 CET
The values of dest_name and src_name are better of in

if(dest_info != NULL && src_info != NULL)
Comment 10 Eric Koegel editbugs 2012-02-03 12:27:57 CET
Created attachment 4165 
[PATCH] Right-click Drag and Drop

Fixed. Now it checks if the names are not NULL.
Thanks.
Comment 11 Nick Schermer editbugs 2012-02-05 23:00:11 CET
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.
Comment 12 Eric Koegel editbugs 2012-02-06 06:49:32 CET
Created attachment 4166 
[PATCH] Right-click Drag and Drop

Oh right... I'm an idiot. Should be fixed now.

Bug #4004

Reported by:
Forest
Reported on: 2008-04-10
Last modified on: 2012-02-13

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
4 users

Version

Attachments

Additional information