Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Make SDL support the X11 clipboard TARGETS protocol, which advertises…
Browse files Browse the repository at this point in the history
… 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 63149b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions src/video/x11/SDL_x11events.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 63149b8

Please sign in to comment.