From 63149b83ee6cc2d030e13a09e074fa5b53b25545 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 22 Mar 2013 11:42:31 -0700 Subject: [PATCH] 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. --- .../English.lproj/InfoPlist.strings | Bin 588 -> 588 bytes .../English.lproj/InfoPlist.strings | Bin 588 -> 588 bytes .../English.lproj/InfoPlist.strings | Bin 588 -> 588 bytes src/video/x11/SDL_x11events.c | 8 ++++++++ 4 files changed, 8 insertions(+) diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings index 38224b5a6dc9494230bdffbcad9c8bd915f478d9..e612457676d964a8021d20ec90290d5c6c3d88c1 100755 GIT binary patch delta 12 TcmX@Za)yQZ-+zXUOrA^tB1QzC delta 13 UcmX@Za)yQJ|G$mQo=l7k04L%Epa1{> diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings index 38224b5a6dc9494230bdffbcad9c8bd915f478d9..e612457676d964a8021d20ec90290d5c6c3d88c1 100755 GIT binary patch delta 12 TcmX@Za)yQZ-+zXUOrA^tB1QzC delta 13 UcmX@Za)yQJ|G$mQo=l7k04L%Epa1{> diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings index 38224b5a6dc9494230bdffbcad9c8bd915f478d9..e612457676d964a8021d20ec90290d5c6c3d88c1 100755 GIT binary patch delta 12 TcmX@Za)yQZ-+zXUOrA^tB1QzC delta 13 UcmX@Za)yQJ|G$mQo=l7k04L%Epa1{> diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 916ca9662..6c54e9dc9 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -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); }