src/video/x11/SDL_x11events.c
changeset 7021 eba9097a07dc
parent 7001 ccc0d3207639
child 7089 257fc4e541e1
equal deleted inserted replaced
7020:a500a9dbfb41 7021:eba9097a07dc
   733             sevent.xselection.time = req->time;
   733             sevent.xselection.time = req->time;
   734             if (XGetWindowProperty(display, DefaultRootWindow(display),
   734             if (XGetWindowProperty(display, DefaultRootWindow(display),
   735                     XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target,
   735                     XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target,
   736                     &sevent.xselection.target, &seln_format, &nbytes,
   736                     &sevent.xselection.target, &seln_format, &nbytes,
   737                     &overflow, &seln_data) == Success) {
   737                     &overflow, &seln_data) == Success) {
       
   738                 Atom XA_TARGETS = XInternAtom(display, "TARGETS", 0);
   738                 if (sevent.xselection.target == req->target) {
   739                 if (sevent.xselection.target == req->target) {
   739                     XChangeProperty(display, req->requestor, req->property,
   740                     XChangeProperty(display, req->requestor, req->property,
   740                         sevent.xselection.target, seln_format, PropModeReplace,
   741                         sevent.xselection.target, seln_format, PropModeReplace,
   741                         seln_data, nbytes);
   742                         seln_data, nbytes);
       
   743                     sevent.xselection.property = req->property;
       
   744                 } else if (XA_TARGETS == req->target) {
       
   745                     Atom SupportedFormats[] = { sevent.xselection.target, XA_TARGETS };
       
   746                     XChangeProperty(display, req->requestor, req->property,
       
   747                         XA_ATOM, 32, PropModeReplace,
       
   748                         (unsigned char*)SupportedFormats,
       
   749                         sizeof(SupportedFormats)/sizeof(*SupportedFormats));
   742                     sevent.xselection.property = req->property;
   750                     sevent.xselection.property = req->property;
   743                 }
   751                 }
   744                 XFree(seln_data);
   752                 XFree(seln_data);
   745             }
   753             }
   746             XSendEvent(display, req->requestor, False, 0, &sevent);
   754             XSendEvent(display, req->requestor, False, 0, &sevent);