Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make SDL support the X11 clipboard TARGETS protocol, which advertises…

… what formats text is available in from the application. This is necessary for many Linux programs to interact well with the clipboard.
  • Loading branch information
slouken committed Mar 22, 2013
1 parent 59ca9bc commit 63149b83ee6cc2d030e13a09e074fa5b53b25545
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -735,11 +735,19 @@ X11_DispatchEvent(_THIS)
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);
}

0 comments on commit 63149b8

Please sign in to comment.