GNOME Bugzilla – Bug 151598
File DnD on panel launchers doesn't work
Last modified: 2020-11-06 20:22:15 UTC
Please describe the problem: If I drop (e.g.) some text files from my file manager (nautilus or rox) on a panel launcher (scite), the application starts up, but is ignoring the dropped files. Steps to reproduce: 1. Open a nautilus window 2. drop a/some files on a panel launcher Actual results: The application connected to the launcher starts up, but without opening the files. Expected results: The specific application should open the dropped files. Does this happen every time? 1. Open a nautilus window 2. drop a/some files on a panel launcher Other information:
How did you create the launcher? You should have %U somewhere in the command line to make this work. For example, add a gedit launcher by copying it from the menu and then edit it.
Yes, you are right, most of my .desktop's files in /usr/share/applications don't have any %U or %F. So it's up to blame the package maintainers or distributors (gentoo in my case). But it is still strange, because it works with the same launchers on the Desktop, so maybe the behavior should be changed: if (<exec-string> contains %[UF]) { "old-method" else <exec-string> "$@" Otherwise you would have to document -- in a clear way, while generating the launcher -- how to make it right.
Need to look how nautilus handles that and have some consistency. I'm not sure it's good to do this this way. Reopening the bug.
Yes, consistency with nautilus would be good. This would also mean that dropping files on a "directory launcher" copies/moves them to that directory.
Vincent: What were the results of your investigation? Would be nice to have this sorted out.
Christian: I didn't have time to look at what nautilus is doing exactly, so no results.
From what I see, nautilus behaves as exactly told in #2. If there's %[UF] it substitutes the %[UF] with dragged file, if there's not %[UF] it just behaves as if there's %[UF] at the end of launchers command line.
I can't reproduce this anymore in 2.19.5 so i guess the bug should be closed.
Cosimo: it probably depends on which launcher you drop this. Or did the nautilus behavior change?
Vincent: you're right. I overlooked the fact that i tried to reproduce this with launchers that had always %[UF] in the command line (on my Gentoo, every launcher i saw had either %U or %F if it was supposed to open files), so I was getting the same behaviour of both panel and nautilus. I think that the right behaviour is the panel one, but i must admit that it might be awful for the user if the mantainer/distributor of some application did not made the launcher properly and you could not use DnD, so we might implement this here also for consistency.
Created attachment 99844 [details] [review] Patch for bug #151598 Appends %U to command lines without %U or %F.
Is the patch OK?
I'm 99% sure that the patch will cause a broken behavior with some of the .desktop files that exist out there. We can't assume that the app will support %U if there's no %U.
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years. If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/gnome-panel/-/issues/ Thank you for reporting this issue and we are sorry it could not be fixed.