(get_selection): If decoding fails and *type is not
authorhanda <handa>
Thu, 22 Jul 2004 12:11:04 +0000 (12:11 +0000)
committerhanda <handa>
Thu, 22 Jul 2004 12:11:04 +0000 (12:11 +0000)
XA_UTF8_STRING, try to get selection value of type XA_UTF8_STRING.

example/medit.c

index d8d25d2..31bbf1a 100644 (file)
@@ -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 ();