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.
authorSam Lantinga <slouken@libsdl.org>
Fri, 22 Mar 2013 11:42:31 -0700
changeset 7021eba9097a07dc
parent 7020 a500a9dbfb41
child 7022 d9f3d2e3bd07
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.
Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings
Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings
Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings
src/video/x11/SDL_x11events.c
     1.1 Binary file Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings has changed
     2.1 Binary file Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings has changed
     3.1 Binary file Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings has changed
     4.1 --- a/src/video/x11/SDL_x11events.c	Tue Mar 19 23:24:24 2013 -0700
     4.2 +++ b/src/video/x11/SDL_x11events.c	Fri Mar 22 11:42:31 2013 -0700
     4.3 @@ -735,11 +735,19 @@
     4.4                      XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target,
     4.5                      &sevent.xselection.target, &seln_format, &nbytes,
     4.6                      &overflow, &seln_data) == Success) {
     4.7 +                Atom XA_TARGETS = XInternAtom(display, "TARGETS", 0);
     4.8                  if (sevent.xselection.target == req->target) {
     4.9                      XChangeProperty(display, req->requestor, req->property,
    4.10                          sevent.xselection.target, seln_format, PropModeReplace,
    4.11                          seln_data, nbytes);
    4.12                      sevent.xselection.property = req->property;
    4.13 +                } else if (XA_TARGETS == req->target) {
    4.14 +                    Atom SupportedFormats[] = { sevent.xselection.target, XA_TARGETS };
    4.15 +                    XChangeProperty(display, req->requestor, req->property,
    4.16 +                        XA_ATOM, 32, PropModeReplace,
    4.17 +                        (unsigned char*)SupportedFormats,
    4.18 +                        sizeof(SupportedFormats)/sizeof(*SupportedFormats));
    4.19 +                    sevent.xselection.property = req->property;
    4.20                  }
    4.21                  XFree(seln_data);
    4.22              }