… | |
… | |
334 | scr_scroll_text (0, (int)nrow - 1, -k, 1); |
334 | scr_scroll_text (0, (int)nrow - 1, -k, 1); |
335 | screen.cur.row += k; |
335 | screen.cur.row += k; |
336 | screen.s_cur.row += k; |
336 | screen.s_cur.row += k; |
337 | TermWin.nscrolled -= k; |
337 | TermWin.nscrolled -= k; |
338 | } |
338 | } |
|
|
339 | |
339 | #ifdef DEBUG_STRICT |
340 | #ifdef DEBUG_STRICT |
340 | assert (screen.cur.row < TermWin.nrow); |
341 | assert (screen.cur.row < TermWin.nrow); |
341 | #else /* drive with your eyes closed */ |
342 | #else /* drive with your eyes closed */ |
342 | |
|
|
343 | MIN_IT (screen.cur.row, nrow - 1); |
343 | MIN_IT (screen.cur.row, nrow - 1); |
344 | #endif |
344 | #endif |
345 | TermWin.ncol = ncol; // save b/c scr_blank_screen_mem uses this |
345 | TermWin.ncol = ncol; // save b/c scr_blank_screen_mem uses this |
346 | } |
346 | } |
347 | |
347 | |
… | |
… | |
3409 | selection_delimit_word (DN, &selection.end, &selection.end); |
3409 | selection_delimit_word (DN, &selection.end, &selection.end); |
3410 | } |
3410 | } |
3411 | else if (selection.clicks == 3) |
3411 | else if (selection.clicks == 3) |
3412 | { |
3412 | { |
3413 | #if ENABLE_FRILLS |
3413 | #if ENABLE_FRILLS |
3414 | if ((options & Opt_tripleclickwords)) |
3414 | if (options & Opt_tripleclickwords) |
3415 | { |
3415 | { |
3416 | int end_row; |
3416 | int end_row; |
3417 | |
3417 | |
3418 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3418 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3419 | end_row = screen.tlen[selection.mark.row + TermWin.saveLines]; |
3419 | end_row = screen.tlen[selection.mark.row + TermWin.saveLines]; |
… | |
… | |
3437 | if (ROWCOL_IS_AFTER (selection.mark, selection.beg)) |
3437 | if (ROWCOL_IS_AFTER (selection.mark, selection.beg)) |
3438 | selection.mark.col++; |
3438 | selection.mark.col++; |
3439 | |
3439 | |
3440 | selection.beg.col = 0; |
3440 | selection.beg.col = 0; |
3441 | selection.end.col = ncol; |
3441 | selection.end.col = ncol; |
|
|
3442 | |
|
|
3443 | // select a complete logical line |
|
|
3444 | while (selection.beg.row > -TermWin.saveLines |
|
|
3445 | && screen.tlen[selection.beg.row - 1 + TermWin.saveLines] == -1) |
|
|
3446 | selection.beg.row--; |
|
|
3447 | |
|
|
3448 | while (selection.end.row < TermWin.nrow |
|
|
3449 | && screen.tlen[selection.end.row + TermWin.saveLines] == -1) |
|
|
3450 | selection.end.row++; |
3442 | } |
3451 | } |
3443 | } |
3452 | } |
3444 | |
3453 | |
3445 | if (button3 && buttonpress) |
3454 | if (button3 && buttonpress) |
3446 | { /* mark may need to be changed */ |
3455 | { /* mark may need to be changed */ |
… | |
… | |
3526 | */ |
3535 | */ |
3527 | void |
3536 | void |
3528 | rxvt_term::selection_send (const XSelectionRequestEvent &rq) |
3537 | rxvt_term::selection_send (const XSelectionRequestEvent &rq) |
3529 | { |
3538 | { |
3530 | XSelectionEvent ev; |
3539 | XSelectionEvent ev; |
|
|
3540 | dDisp; |
3531 | |
3541 | |
3532 | ev.type = SelectionNotify; |
3542 | ev.type = SelectionNotify; |
3533 | ev.property = None; |
3543 | ev.property = None; |
3534 | ev.display = rq.display; |
3544 | ev.display = rq.display; |
3535 | ev.requestor = rq.requestor; |
3545 | ev.requestor = rq.requestor; |
… | |
… | |
3549 | *target++ = xa[XA_COMPOUND_TEXT]; |
3559 | *target++ = xa[XA_COMPOUND_TEXT]; |
3550 | #if X_HAVE_UTF8_STRING |
3560 | #if X_HAVE_UTF8_STRING |
3551 | *target++ = xa[XA_UTF8_STRING]; |
3561 | *target++ = xa[XA_UTF8_STRING]; |
3552 | #endif |
3562 | #endif |
3553 | |
3563 | |
3554 | XChangeProperty (display->display, rq.requestor, rq.property, XA_ATOM, |
3564 | XChangeProperty (disp, rq.requestor, rq.property, XA_ATOM, |
3555 | 32, PropModeReplace, |
3565 | 32, PropModeReplace, |
3556 | (unsigned char *)target_list, target - target_list); |
3566 | (unsigned char *)target_list, target - target_list); |
3557 | ev.property = rq.property; |
3567 | ev.property = rq.property; |
3558 | } |
3568 | } |
3559 | #if TODO // TODO |
3569 | #if TODO // TODO |
… | |
… | |
3562 | /* TODO: Handle MULTIPLE */ |
3572 | /* TODO: Handle MULTIPLE */ |
3563 | } |
3573 | } |
3564 | #endif |
3574 | #endif |
3565 | else if (rq.target == xa[XA_TIMESTAMP] && selection.text) |
3575 | else if (rq.target == xa[XA_TIMESTAMP] && selection.text) |
3566 | { |
3576 | { |
3567 | XChangeProperty (display->display, rq.requestor, rq.property, rq.target, |
3577 | XChangeProperty (disp, rq.requestor, rq.property, rq.target, |
3568 | 32, PropModeReplace, (unsigned char *)&selection_time, 1); |
3578 | 32, PropModeReplace, (unsigned char *)&selection_time, 1); |
3569 | ev.property = rq.property; |
3579 | ev.property = rq.property; |
3570 | } |
3580 | } |
3571 | else if (rq.target == XA_STRING |
3581 | else if (rq.target == XA_STRING |
3572 | || rq.target == xa[XA_TEXT] |
3582 | || rq.target == xa[XA_TEXT] |
… | |
… | |
3630 | ct.value = (unsigned char *)rxvt_wcstoutf8 (cl, selectlen); |
3640 | ct.value = (unsigned char *)rxvt_wcstoutf8 (cl, selectlen); |
3631 | ct.nitems = strlen ((char *)ct.value); |
3641 | ct.nitems = strlen ((char *)ct.value); |
3632 | } |
3642 | } |
3633 | else |
3643 | else |
3634 | #endif |
3644 | #endif |
3635 | if (XwcTextListToTextProperty (display->display, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0) |
3645 | if (XwcTextListToTextProperty (disp, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0) |
3636 | freect = 1; |
3646 | freect = 1; |
3637 | else |
3647 | else |
3638 | { |
3648 | { |
3639 | /* if we failed to convert then send it raw */ |
3649 | /* if we failed to convert then send it raw */ |
3640 | ct.value = (unsigned char *)cl; |
3650 | ct.value = (unsigned char *)cl; |
3641 | ct.nitems = selectlen; |
3651 | ct.nitems = selectlen; |
3642 | ct.encoding = target; |
3652 | ct.encoding = target; |
3643 | } |
3653 | } |
3644 | |
3654 | |
3645 | XChangeProperty (display->display, rq.requestor, rq.property, |
3655 | XChangeProperty (disp, rq.requestor, rq.property, |
3646 | ct.encoding, 8, PropModeReplace, |
3656 | ct.encoding, 8, PropModeReplace, |
3647 | ct.value, (int)ct.nitems); |
3657 | ct.value, (int)ct.nitems); |
3648 | ev.property = rq.property; |
3658 | ev.property = rq.property; |
3649 | |
3659 | |
3650 | if (freect) |
3660 | if (freect) |
3651 | XFree (ct.value); |
3661 | XFree (ct.value); |
3652 | } |
3662 | } |
3653 | |
3663 | |
3654 | XSendEvent (display->display, rq.requestor, False, 0L, (XEvent *)&ev); |
3664 | XSendEvent (disp, rq.requestor, False, 0L, (XEvent *)&ev); |
3655 | } |
3665 | } |
3656 | |
3666 | |
3657 | /* ------------------------------------------------------------------------- * |
3667 | /* ------------------------------------------------------------------------- * |
3658 | * MOUSE ROUTINES * |
3668 | * MOUSE ROUTINES * |
3659 | * ------------------------------------------------------------------------- */ |
3669 | * ------------------------------------------------------------------------- */ |