From 7eef67d07cbcd7fff9597875ba493925699944bd Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 22 Jul 2004 12:11:04 +0000 Subject: [PATCH] (get_selection): If decoding fails and *type is not XA_UTF8_STRING, try to get selection value of type XA_UTF8_STRING. --- example/medit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/medit.c b/example/medit.c index d8d25d2..31bbf1a 100644 --- a/example/medit.c +++ b/example/medit.c @@ -1070,6 +1070,12 @@ get_selection (Widget w, XtPointer cliend_data, Atom *selection, Atom *type, goto err; this_mt = mconv_decode_buffer (coding, (unsigned char *) value, *length); + if (! this_mt && *type != XA_UTF8_STRING) + { + XtGetSelectionValue (w, XA_PRIMARY, XA_UTF8_STRING, get_selection, NULL, + CurrentTime); + goto err; + } if (this_mt) { hide_cursor (); -- 1.7.10.4