src/video/x11/SDL_x11events.c
changeset 7021 eba9097a07dc
parent 7001 ccc0d3207639
child 7089 257fc4e541e1
--- a/src/video/x11/SDL_x11events.c	Tue Mar 19 23:24:24 2013 -0700
+++ b/src/video/x11/SDL_x11events.c	Fri Mar 22 11:42:31 2013 -0700
@@ -735,11 +735,19 @@
                     XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target,
                     &sevent.xselection.target, &seln_format, &nbytes,
                     &overflow, &seln_data) == Success) {
+                Atom XA_TARGETS = XInternAtom(display, "TARGETS", 0);
                 if (sevent.xselection.target == req->target) {
                     XChangeProperty(display, req->requestor, req->property,
                         sevent.xselection.target, seln_format, PropModeReplace,
                         seln_data, nbytes);
                     sevent.xselection.property = req->property;
+                } else if (XA_TARGETS == req->target) {
+                    Atom SupportedFormats[] = { sevent.xselection.target, XA_TARGETS };
+                    XChangeProperty(display, req->requestor, req->property,
+                        XA_ATOM, 32, PropModeReplace,
+                        (unsigned char*)SupportedFormats,
+                        sizeof(SupportedFormats)/sizeof(*SupportedFormats));
+                    sevent.xselection.property = req->property;
                 }
                 XFree(seln_data);
             }