After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 51614 - DnD problem in gnome-terminal (fix supplied)
DnD problem in gnome-terminal (fix supplied)
Status: RESOLVED FIXED
Product: gnome-core
Classification: Deprecated
Component: gnome-terminal
1.2.x
Other Linux
: Normal normal
: 1.4.1
Assigned To: gnome-core Maintainers
gnome-core Maintainers
Depends on:
Blocks:
 
 
Reported: 2001-03-03 17:42 UTC by Thomas Leonard
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Attaching a patch (against 1.4.0) in the hope this can finally be closed! (612 bytes, patch)
2002-01-17 15:37 UTC, Thomas Leonard
none Details | Review

Description Thomas Leonard 2001-03-03 17:42:29 UTC
The gnome-terminal manual claims that files and URIs can be dragged
onto a terminal. However, this doesn't work and looking at the source
code, it seems that it doesn't accept 'text/uri-list' as a valid
target (this seems to be the obvious target name).

The solution is to add:
	{ "text/uri-list", 0, TARGET_STRING },
to the list of drop targets, which shouldn't break anything.

Thanks,
Comment 1 Thomas Leonard 2001-05-06 13:09:38 UTC
The XDND spec for dragging files is here:

http://www.newplanetsoftware.com/xdnd/dragging_files.html

From the spec:

"Note that, in general, the source should not provide any types other 
than text/uri-list. This is because anything on the file system can be 
dragged: plain text, HTML, images, binary executables, or even 
directories. The only type that encompasses all these is 
text/uri-list. All of these can even be dragged at the same time. It 
is the target's responsibility to sort out what was dropped and do 
something reasonable."

Therefore, a conforming filer cannot provide targets text/plain or
STRING, which you rely on. Thank you for your time.
Comment 2 Kjartan Maraas 2001-09-04 22:40:25 UTC
This has been fixed in a later release, no? It works just fine here.
Comment 3 Thomas Leonard 2001-09-06 11:42:33 UTC
>gnome-terminal --version
Gnome Terminal 1.4.0.4

Dragging a text file inserts its contents; if any other type of file
is dragged, the drop is refused.

Also, grepping the CVS sources for the target text/uri-list, it
doesn't seem to be present at all! Adding the line in the first
message should fix the problem. Thank you.
Comment 4 Kjartan Maraas 2001-09-18 14:54:54 UTC
Forwarding.
Comment 5 Thomas Leonard 2002-01-17 15:37:40 UTC
Created attachment 6423 [details] [review]
Attaching a patch (against 1.4.0) in the hope this can finally be closed!
Comment 6 Thomas Leonard 2002-01-17 15:43:52 UTC
The above patch does two things:

- It allows a file or directory to be dragged from a filer window
  into gnome-terminal and have the name of the file inserted.

  Note that this already worked for gmc, by not for all filers. In 
  particular, it didn't work with filers that follow the XDND spec.

- It strips extra leading '/' characters from the name, so that
  'file:///path/file' is inserted as '/path/file'.

The patch doesn't break compatibility with gmc. Please let me know if
you have any questions about the XDND protocol or this patch.

Thanks,

Comment 7 Kjartan Maraas 2002-01-18 21:13:28 UTC
What programs did you drag from? I can do it from mozilla and
konqueror without this patch. Maybe the text/uri-list target is
handled by zvt rather than gnome-terminal itself?
Comment 8 Thomas Leonard 2002-01-19 14:33:59 UTC
I'm dragging from ROX-Filer:

http://rox.sf.net/rox_filer.php3

I realize that several programs have followed gmc's lead in allowing
a program to request either a file list or plain text and get the file
list either way, but it is not correct to do this!

Thanks,
Comment 9 Kjartan Maraas 2002-01-19 15:50:38 UTC
I tested this against xterm and was unable to drop anything from rox
filer to xterm. Are you sure that rox is doing the right thing here? I
think one of the main points with gnome-terminal is bein compatible
with xterm.
Comment 10 Thomas Leonard 2002-01-19 16:01:33 UTC
I don't understand... xterm doesn't support drag-and-drop at all.
You can't drag into it from gmc either, or from nautilus.

Here is a quote from John Lindal (author of the XDND protocol)
on the subject:

>>> Is anybody actually claiming that text/plain is the correct thing to
>>> request??
>>   
>> gmc and nautilus at least support this, so most of the GNOME apps think
>> it's the right thing to do :-(

>They provide text/plain when dragging files?  That's nuts.  Refer them to
>my updated dragging_files.html and they'll understand why.


(see further up this bug report for the link)


On a vaguely related note, it is possible to copy the filename into
xterm by selecting the file in ROX-Filer and doing a middle-button
paste into it; this has recently stopped working in gnome-terminal,
but I don't know why.


Thanks,

Comment 11 Thomas Leonard 2002-01-21 17:01:59 UTC
The selection problem above turned out to be unrelated (zvt has stopped
accepting the STRING target and wanted COMPOUND_TEXT instead).

This doesn't affect the original DnD problem, though - the patch still
needs to be applied.
Comment 12 Kjartan Maraas 2002-01-21 22:45:11 UTC
I applied it. Thanks for your patience :)