diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index 9c8bb860447df4bafe20ac93883a16415a5ae962..96fcd7fceb109333a12a1c91d146466f45f34098 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -254,6 +254,7 @@ static int init_window()
 	}
 	xfd = ConnectionNumber(dpy);
 	x11.utf8 = x11.XInternAtom(dpy, "UTF8_STRING", False);
+	x11.targets = x11.XInternAtom(dpy, "TARGETS", False);
 
 	template.screen = DefaultScreen(dpy);
 	template.class = TrueColor;
@@ -641,6 +642,7 @@ static int x11_event(XEvent *ev)
 			{
 				XSelectionRequestEvent *req;
 				XEvent respond;
+				Atom supported[2];
 
 				req=&(ev->xselectionrequest);
 				pthread_mutex_lock(&copybuf_mutex);
@@ -661,6 +663,15 @@ static int x11_event(XEvent *ev)
 							respond.xselection.property=req->property;
 						}
 					}
+					else if(req->target == x11.targets) {
+						supported[0] = XA_STRING;
+						if (x11.utf8) {
+							supported[1] = x11.utf8;
+							x11.XChangeProperty(dpy, req->requestor, req->property, req->target, 32, PropModeReplace, (unsigned char *)supported, 2);
+						}
+						else
+							x11.XChangeProperty(dpy, req->requestor, req->property, req->target, 32, PropModeReplace, (unsigned char *)supported, 1);
+					}
 					else
 						respond.xselection.property=None;
 				}
diff --git a/src/conio/x_events.h b/src/conio/x_events.h
index 244fc1ea8263fb80b61333438d8e50a46002a128..ef8b1e6ff2abfd613b9de0677dbf932b8e656425 100644
--- a/src/conio/x_events.h
+++ b/src/conio/x_events.h
@@ -81,6 +81,7 @@ struct x11 {
                        unsigned int class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes);
 	Colormap (*XCreateColormap)(Display *display, Window w, Visual *visual, int alloc);
 	Atom utf8;
+	Atom targets;
 };
 
 extern int local_pipe[2];			/* Used for passing local events */