Bug 228891 - drag file from kde dolphin to gtk application not working
Summary: drag file from kde dolphin to gtk application not working
Status: RESOLVED NOT A BUG
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-28 14:49 UTC by Benny
Modified: 2010-08-15 13:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benny 2010-02-28 14:49:32 UTC
Version:            (using KDE 4.3.2)
OS:                Linux
Installed from:    Ubuntu Packages

Trying to drag a file from the dolphin/konqueror to a gtk application is not working an a gtk.Widget, but works on a gtk.Treeview. Doing the same from eg amarok filefolder works just fine in both cases.
This indicates the problem is with dolphin not setting correctly some values to make dropping work ok.

Test: install Gramps, a gtk application, and go to media view. One can drag and drop files on the media view. Doing this from dolphin does not work. Doing this from amarok works without problems. The gtk code does:

self.list.drag_dest_set(gtk.DEST_DEFAULT_ALL, dnd_types, 
                        gtk.gdk.ACTION_PRIVATE)
where dnd_types is [('text/uri-list', 0, 5)], so a text/uri-list. 
This is gtk code for drop on a widget. If one drops on a treeview, dolphin drops fine (eg again in Gramps: add a person, go to Gallery tab, drop a file from dolphin.

Adding some prints on this gallerytab code gives: 
context.targets = ['text/uri-list', 'text/x-moz-url', 'text/plain', 'UTF8_STRING', 'STRING', 'TEXT', 'COMPOUND_TEXT', 'application/x-qiconlist']
data.get_uris = ('file:///home/benny/gramps/trunk/example/gramps/O1.jpg',)

This indicates that dolphin sets the values correct, but the handler has problems with gtk widgets?? 
The problem could be in the core GTK libraries, but amarok succeeding in doing the drag and drop makes me thing that is not the case.

Other person with this problem: http://ubuntuforums.org/showthread.php?p=8744357#post8744357
Comment 1 Benny 2010-03-01 10:02:51 UTC
Somebody found the solution: it is needed for drop to work to specify the move flag: gtk.gdk.ACTION_MOVE 
With windows this is not needed. 
So, this can be considered as a bug, or as a works as designed.

Full details: 
http://hammered999.wordpress.com/2010/02/28/how-to-accept-a-drag-and-drop-ped-file-in-your-gtkmm-application/
Search for Dolphin to see where it says ACTION_MOVE is needed.

For my own application, to have it working nicely I need to do:

self.list.drag_dest_set(gtk.DEST_DEFAULT_MOTION|gtk.DEST_DEFAULT_DROP, 
                                dnd_types, 
                                gtk.gdk.ACTION_MOVE|gtk.gdk.ACTION_COPY)

Somehow gtk.DEST_DEFAULT_HIGHLIGHT makes the update of the icon to an icon that can drop go wrong a lot of the times.

So, feel to close this bug if this is the normal behavior for QT apps file drops.
Comment 2 Peter Penz 2010-08-15 13:34:51 UTC
Sorry for the late reply... Corresponding to your comment #1 there seems to be nothing I can do against this from a Dolphin point of view, so I'll close this issue if this OK for you. Thanks!