diff -urN aterm-0.4.2.orig/autoconf/configure.in aterm-0.4.2/autoconf/configure.in --- aterm-0.4.2.orig/autoconf/configure.in Fri Sep 7 01:38:07 2001 +++ aterm-0.4.2/autoconf/configure.in Mon Sep 17 06:28:09 2001 @@ -639,6 +639,14 @@ AC_DEFINE_UNQUOTED(TTYTAB_FILENAME, "$rxvt_cv_path_ttytab") fi +dnl# find X Library +AC_CHECK_LIB(Xmu, XmuInternAtom, X_LIBS="-lXmu $X_LIBS", [ +echo "ERROR: You need libXmu to build Eterm. Verify that you have libXmu.a or"; +echo " libXmu.so installed and that it is located in the X libraries"; +echo " directory shown above. If it is in a different directory, try using"; +echo " the --x-libraries parameter to configure."; + AC_MSG_ERROR([Fatal: libXmu not found.])], $X_LIBS $SUBLIBS) + dnl# this is a really hack test for some basic Xlocale stuff SAVETHELIBS=$LIBS LIBS="$LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11" diff -urN aterm-0.4.2.orig/src/screen.c aterm-0.4.2/src/screen.c --- aterm-0.4.2.orig/src/screen.c Fri Sep 7 01:38:07 2001 +++ aterm-0.4.2/src/screen.c Mon Sep 17 06:33:05 2001 @@ -44,7 +44,7 @@ #include #include /* get the typedef for CARD32 */ - +#include static screen_t screen; @@ -2761,6 +2761,9 @@ unsigned char *data; Atom actual_type; int actual_fmt; + XTextProperty xtextp; + int size, i, ret; + char **cl; if (prop == None) return; @@ -2772,7 +2775,24 @@ XFree(data); return; } - PasteIt(data, nitems); + if (actual_type == XA_STRING) { + /* for Netscape-3.01 ... etc. They are not using compound text. + * Please do not send Japanese text coded by extended unix code. + * (;_;) + */ + PasteIt(data, strlen(data)); + } else { + xtextp.value = data; + xtextp.encoding = actual_type; + xtextp.format = actual_fmt; + xtextp.nitems = nitems; + XmbTextPropertyToTextList(Xdisplay, &xtextp, &cl, &size); + + for (i = 0 ; i < size ; i ++) { + PasteIt(cl[i], strlen(cl[i])); + } + XFreeStringList(cl); + } XFree(data); } } @@ -2797,7 +2817,7 @@ selection_paste(Xroot, XA_CUT_BUFFER0, False); } else { prop = XInternAtom(Xdisplay, "VT_SELECTION", False); - XConvertSelection(Xdisplay, XA_PRIMARY, XA_STRING, prop, TermWin.vt, + XConvertSelection(Xdisplay, XA_PRIMARY, XA_COMPOUND_TEXT(Xdisplay), prop, TermWin.vt, tm); } } @@ -2833,6 +2853,8 @@ unsigned char *new_selection_text; char *str; text_t *t; + char *l[1]; + XTextProperty xtextp; D_SELECT((stderr, "selection_make(): selection.op=%d, selection.clicks=%d", selection.op, selection.clicks)); switch (selection.op) { @@ -3351,10 +3373,23 @@ (unsigned char *)target_list, (sizeof(target_list) / sizeof(target_list[0]))); ev.xselection.property = rq->property; - } else if (rq->target == XA_STRING) { - XChangeProperty(Xdisplay, rq->requestor, rq->property, rq->target, - 8, PropModeReplace, selection.text, selection.len); - ev.xselection.property = rq->property; + } else if (rq->target == XA_STRING || + rq->target == XA_TEXT(Xdisplay) || + rq->target == XA_COMPOUND_TEXT(Xdisplay)) { + XTextProperty xtextp; + char *l[1]; + *l = selection.text; + xtextp.value = NULL; + xtextp.nitems = 0; + if (XmbTextListToTextProperty(Xdisplay, l, + 1, XCompoundTextStyle, &xtextp) == Success) { + if (xtextp.nitems > 0 && xtextp.value != NULL) { + XChangeProperty( Xdisplay, rq->requestor, rq->property, + XA_COMPOUND_TEXT(Xdisplay), 8, PropModeReplace, + xtextp.value, xtextp.nitems ); + ev.xselection.property = rq->property ; + } + } } XSendEvent(Xdisplay, rq->requestor, False, 0, &ev); }