! 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 !
Moving a file from Thunar to the desktop fails on drag and drop
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Patrick Melo 2011-05-17 08:32:01 CEST
Created attachment 3678 
Working Patch

When moving a file from a Thunar window to the desktop it fails with a message saying the file (the target) can not be found (or created) (I don't know the exact message in english because my locale is not english).

How to reproduce:

1 - open a thunar window.
2 - drag a file to the desktop holding the shift key.
3 - the message appears.

I think I've found the reason and a possible solution:

It appears that when we copy the file to the desktop, the xfdesktop has to send the target file full path over DBus for thunar to copy the file. This is working as expected.

BUT, if we move the file to the desktop, xfdesktop should send just the target directory where the file will be moved INTO.

And, as I've found, when moving the files, the xfdesktop still sends the full destination path, this way Thunar appends the file base name to the already correct full path, causing the error.

To solve that, I've put a condition that checks if it's a copy or move operation and then sends the correct target path.

I'm not sure if it's a fix or just a workaround, but it works... :)

---
System Info

Distro: Arch Linux (amd64)
Thunar Version: 1.2.1
Xfdesktop Version: 4.8.2
---
Comment 1 Jannis Pohlmann editbugs 2011-05-17 15:37:13 CEST
Looks good, except that I'd only allocate dest_file if we really need to. But I can fix that when applying the patch.
Comment 2 Patrick Melo 2011-05-17 16:49:38 CEST
Nice, I hope it helps. :)
Comment 3 Jannis Pohlmann editbugs 2011-05-20 01:52:39 CEST
Tested it and it works, thanks! I pushed it to master:

commit 6bfb354ad75e292c15f29a73c357c131485c3aff
Author: Jannis Pohlmann <jannis@xfce.org>
Date:   Fri May 20 01:51:35 2011 +0200

    Fix moving files to the desktop with shift & drag (bug #7629).
    
    Patch provided by Patrick Melo <patrickmelo.eti@gmail.com>.
Comment 4 Jannis Pohlmann editbugs 2011-05-20 01:56:48 CEST
I also applied the same fix to the xfce-4.8 branch, so xfdesktop 4.8.3 will include it.
Comment 5 Lionel Le Folgoc 2011-08-17 23:22:38 CEST
*** Bug 7891 has been marked as a duplicate of this bug. ***

Bug #7629

Reported by:
Patrick Melo
Reported on: 2011-05-17
Last modified on: 2011-08-17
Duplicates (1):
  • 7891 Unable to Move Files to the Desktop with Shift Drag

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Version:
Unspecified

Attachments

Working Patch (1.20 KB, patch)
2011-05-17 08:32 CEST , Patrick Melo
no flags

Additional information