From eaa07514754932038c076e98b0e1e99c2d1b55dd Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 13 May 2003 18:43:30 +0000 Subject: [PATCH] Allow pterm to receive selections in compound text format. Doesn't actually _understand_ compound text yet - anything with non-ASCII-or-8859-1 characters will fail miserably - but it will at least successfully receive plain text if the pasting application doesn't see fit to give it out in any other format. git-svn-id: svn://svn.tartarus.org/sgt/putty@3192 cda61777-01e9-0310-a592-d414129be87e --- unix/pterm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/unix/pterm.c b/unix/pterm.c index 8b6cd222..284b5a7e 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -1453,7 +1453,17 @@ void selection_received(GtkWidget *widget, GtkSelectionData *seldata, if (seldata->target == utf8_string_atom && seldata->length <= 0) { /* - * Failed to get a UTF-8 selection string. Try an ordinary + * Failed to get a UTF-8 selection string. Try compound + * text next. + */ + gtk_selection_convert(inst->area, GDK_SELECTION_PRIMARY, + compound_text_atom, GDK_CURRENT_TIME); + return; + } + + if (seldata->target == compound_text_atom && seldata->length <= 0) { + /* + * Failed to get UTF-8 or compound text. Try an ordinary * string. */ gtk_selection_convert(inst->area, GDK_SELECTION_PRIMARY, @@ -1466,6 +1476,7 @@ void selection_received(GtkWidget *widget, GtkSelectionData *seldata, */ if (seldata->length <= 0 || (seldata->type != GDK_SELECTION_TYPE_STRING && + seldata->type != compound_text_atom && seldata->type != utf8_string_atom)) return; /* Nothing happens. */ -- 2.11.0