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 55117 - Add handling for text/plain for DND from standard widgets
Add handling for text/plain for DND from standard widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 58400 130758 144385 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-05-23 18:43 UTC by Owen Taylor
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
handle text/plain (9.98 KB, patch)
2004-07-11 05:45 UTC, Matthias Clasen
none Details | Review

Description Owen Taylor 2001-05-23 18:43:15 UTC
Currently GtkTextView and GtkEntry advertise text/plain
as a supported type, but it doesn't actually work because
gtk_selection_data_set_text() doesn't support it.

text/plain itself is simply a synonym for STRING
(more or less - line ending handling is not clear),
but as a added complication, the XDND spec says you
should handle:

 text-plain;charset=ISO-8859-1

and so forth as well.

(http://www.newplanetsoftware.com/xdnd/)
Comment 1 Owen Taylor 2001-08-02 03:48:17 UTC
*** Bug 58400 has been marked as a duplicate of this bug. ***
Comment 2 Owen Taylor 2002-02-18 22:38:54 UTC
For now, removing text/plain handling; UTF8_STRING should provide
better interoperability.

Mon Feb 18 17:34:43 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkentry.c gtk/gtktextview.c: Remove support for
        the poorly defined text/plain type for now. (#55117)

In the future, a possibly reasonable interpretation of text/plain
would be:

 - offer and receive the three formats:

    text/plain;charset=utf-8
    text/plain;charset=LOCALE_CHARSET
    text/plain

 - For text/plain send only ASCII, but accept 8-bit 
   text and treat it as ISO-8859-1 as specified
   by the Xdnd spec.

 - Always send CRLF terminators. Accept either and convert
   into the native terminator for the platform.

Comment 3 Glynn Foster 2004-01-07 10:34:05 UTC
*** Bug 130758 has been marked as a duplicate of this bug. ***
Comment 4 Matthias Clasen 2004-06-16 14:01:57 UTC
*** Bug 144385 has been marked as a duplicate of this bug. ***
Comment 5 Matthias Clasen 2004-07-11 05:45:14 UTC
Created attachment 29434 [details] [review]
handle text/plain

Here is an attempt to implement text/plain handling as Owen described it.
Comment 6 Owen Taylor 2004-07-16 21:38:29 UTC
I don't think the init_target_table() stuff is acceptable. What if
we added:

 gtk_drag_dest_add_text_targets()
 gtk_drag_source_add_text_targets()
 gtk_target_list_add_text_targets()

Synchronized with the targets supported by 
gtk_selection_data_set/get_text()?

normalize_to_crlf will read off the end of the string for the
case of a \r right at the end of the string, right?

normalize_to_lf also seems to have a problem with \r at the
end of the string.

Other than that, the patch looks good.