ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.380 by sf-exg, Thu Apr 7 12:19:41 2011 UTC vs.
Revision 1.381 by sf-exg, Fri Apr 22 10:01:39 2011 UTC

3405 * EXT: SelectionRequest 3405 * EXT: SelectionRequest
3406 */ 3406 */
3407void 3407void
3408rxvt_term::selection_send (const XSelectionRequestEvent &rq) NOTHROW 3408rxvt_term::selection_send (const XSelectionRequestEvent &rq) NOTHROW
3409{ 3409{
3410 Atom property = rq.property == None ? rq.target : rq.property;
3410 XSelectionEvent ev; 3411 XSelectionEvent ev;
3411 3412
3412 ev.type = SelectionNotify; 3413 ev.type = SelectionNotify;
3413 ev.property = None; 3414 ev.property = None;
3414 ev.display = rq.display; 3415 ev.display = rq.display;
3429 *target++ = xa[XA_COMPOUND_TEXT]; 3430 *target++ = xa[XA_COMPOUND_TEXT];
3430#if X_HAVE_UTF8_STRING 3431#if X_HAVE_UTF8_STRING
3431 *target++ = xa[XA_UTF8_STRING]; 3432 *target++ = xa[XA_UTF8_STRING];
3432#endif 3433#endif
3433 3434
3434 XChangeProperty (dpy, rq.requestor, rq.property, XA_ATOM, 3435 XChangeProperty (dpy, rq.requestor, property, XA_ATOM,
3435 32, PropModeReplace, 3436 32, PropModeReplace,
3436 (unsigned char *)target_list, target - target_list); 3437 (unsigned char *)target_list, target - target_list);
3437 ev.property = rq.property; 3438 ev.property = property;
3438 } 3439 }
3439#if TODO // TODO 3440#if TODO // TODO
3440 else if (rq.target == xa[XA_MULTIPLE]) 3441 else if (rq.target == xa[XA_MULTIPLE])
3441 { 3442 {
3442 /* TODO: Handle MULTIPLE */ 3443 /* TODO: Handle MULTIPLE */
3443 } 3444 }
3444#endif 3445#endif
3445 else if (rq.target == xa[XA_TIMESTAMP] && rq.selection == XA_PRIMARY && selection.text) 3446 else if (rq.target == xa[XA_TIMESTAMP] && rq.selection == XA_PRIMARY && selection.text)
3446 { 3447 {
3447 XChangeProperty (dpy, rq.requestor, rq.property, rq.target, 3448 XChangeProperty (dpy, rq.requestor, property, rq.target,
3448 32, PropModeReplace, (unsigned char *)&selection_time, 1); 3449 32, PropModeReplace, (unsigned char *)&selection_time, 1);
3449 ev.property = rq.property; 3450 ev.property = property;
3450 } 3451 }
3451 else if (rq.target == xa[XA_TIMESTAMP] && rq.selection == xa[XA_CLIPBOARD] && selection.clip_text) 3452 else if (rq.target == xa[XA_TIMESTAMP] && rq.selection == xa[XA_CLIPBOARD] && selection.clip_text)
3452 { 3453 {
3453 XChangeProperty (dpy, rq.requestor, rq.property, rq.target, 3454 XChangeProperty (dpy, rq.requestor, property, rq.target,
3454 32, PropModeReplace, (unsigned char *)&clipboard_time, 1); 3455 32, PropModeReplace, (unsigned char *)&clipboard_time, 1);
3455 ev.property = rq.property; 3456 ev.property = property;
3456 } 3457 }
3457 else if (rq.target == XA_STRING 3458 else if (rq.target == XA_STRING
3458 || rq.target == xa[XA_TEXT] 3459 || rq.target == xa[XA_TEXT]
3459 || rq.target == xa[XA_COMPOUND_TEXT] 3460 || rq.target == xa[XA_COMPOUND_TEXT]
3460 || rq.target == xa[XA_UTF8_STRING] 3461 || rq.target == xa[XA_UTF8_STRING]
3531 ct.value = (unsigned char *)cl; 3532 ct.value = (unsigned char *)cl;
3532 ct.nitems = selectlen; 3533 ct.nitems = selectlen;
3533 ct.encoding = target; 3534 ct.encoding = target;
3534 } 3535 }
3535 3536
3536 XChangeProperty (dpy, rq.requestor, rq.property, 3537 XChangeProperty (dpy, rq.requestor, property,
3537 ct.encoding, 8, PropModeReplace, 3538 ct.encoding, 8, PropModeReplace,
3538 ct.value, (int)ct.nitems); 3539 ct.value, (int)ct.nitems);
3539 ev.property = rq.property; 3540 ev.property = property;
3540 3541
3541 if (freect) 3542 if (freect)
3542 XFree (ct.value); 3543 XFree (ct.value);
3543 } 3544 }
3544 3545

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines