X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=836ae2109a9d8b92eafb0e14a7fbf0640f9c110e;hb=b341e513514d50cc995a5646a1bbace65dc4ca67;hp=4b98b2784aa8ce7e9a068a6a37640c96a8c8cd0c;hpb=2fcfea1bf149f839cdbcba5c1efc7c4ce31f6d95;p=st.git diff --git a/st.c b/st.c index 4b98b27..836ae21 100644 --- a/st.c +++ b/st.c @@ -995,6 +995,8 @@ selnotify(XEvent *e) { ofs = 0; xsev = (XSelectionEvent *)e; + if (xsev->property == None) + return; do { if(XGetWindowProperty(xw.dpy, xw.win, xsev->property, ofs, BUFSIZ/4, False, AnyPropertyType, @@ -1089,7 +1091,11 @@ selrequest(XEvent *e) { XA_ATOM, 32, PropModeReplace, (uchar *) &string, 1); xev.property = xsre->property; - } else if(xsre->target == sel.xtarget) { + } else if(xsre->target == sel.xtarget || xsre->target == XA_STRING) { + /* + * xith XA_STRING non ascii characters may be incorrect in the + * requestor. It is not our problem, use utf8. + */ clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0); if(xsre->selection == XA_PRIMARY) { seltext = sel.primary;