mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
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. [originally from svn r3192]
This commit is contained in:
parent
06e6997a74
commit
ef2ccb56cf
13
unix/pterm.c
13
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. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user