… | |
… | |
2107 | if (wlen < len) |
2107 | if (wlen < len) |
2108 | ::swap (wlen, len); |
2108 | ::swap (wlen, len); |
2109 | |
2109 | |
2110 | XCopyArea (display->display, vt, vt, |
2110 | XCopyArea (display->display, vt, vt, |
2111 | gc, 0, Row2Pixel (len + i), |
2111 | gc, 0, Row2Pixel (len + i), |
2112 | (unsigned int)TermWin_TotalWidth (), |
2112 | (unsigned int)this->width, |
2113 | (unsigned int)Height2Pixel (wlen - len + 1), |
2113 | (unsigned int)Height2Pixel (wlen - len + 1), |
2114 | 0, Row2Pixel (len)); |
2114 | 0, Row2Pixel (len)); |
2115 | len = -1; |
2115 | len = -1; |
2116 | } |
2116 | } |
2117 | } |
2117 | } |
… | |
… | |
2564 | /* ------------------------------------------------------------------------- */ |
2564 | /* ------------------------------------------------------------------------- */ |
2565 | /* |
2565 | /* |
2566 | * Paste a selection direct to the command fd |
2566 | * Paste a selection direct to the command fd |
2567 | */ |
2567 | */ |
2568 | void |
2568 | void |
2569 | rxvt_term::paste (unsigned char *data, unsigned int len) |
2569 | rxvt_term::paste (char *data, unsigned int len) |
2570 | { |
2570 | { |
2571 | /* convert normal newline chars into common keyboard Return key sequence */ |
2571 | /* convert normal newline chars into common keyboard Return key sequence */ |
2572 | for (unsigned int i = 0; i < len; i++) |
2572 | for (unsigned int i = 0; i < len; i++) |
2573 | if (data[i] == C0_LF) |
2573 | if (data[i] == C0_LF) |
2574 | data[i] = C0_CR; |
2574 | data[i] = C0_CR; |
… | |
… | |
2718 | { |
2718 | { |
2719 | wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); |
2719 | wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems); |
2720 | char *s = rxvt_wcstombs (w); |
2720 | char *s = rxvt_wcstombs (w); |
2721 | free (w); |
2721 | free (w); |
2722 | // TODO: strlen == only the first element will be converted. well... |
2722 | // TODO: strlen == only the first element will be converted. well... |
2723 | paste ((unsigned char *)s, strlen (s)); |
2723 | paste (s, strlen (s)); |
2724 | free (s); |
2724 | free (s); |
2725 | } |
2725 | } |
2726 | else |
2726 | else |
2727 | #endif |
2727 | #endif |
2728 | if (XmbTextPropertyToTextList (display->display, &ct, &cl, &cr) >= 0 |
2728 | if (XmbTextPropertyToTextList (display->display, &ct, &cl, &cr) >= 0 |
2729 | && cl) |
2729 | && cl) |
2730 | { |
2730 | { |
2731 | for (int i = 0; i < cr; i++) |
2731 | for (int i = 0; i < cr; i++) |
2732 | paste ((unsigned char *)cl[i], strlen (cl[i])); |
2732 | paste (cl[i], strlen (cl[i])); |
2733 | |
2733 | |
2734 | XFreeStringList (cl); |
2734 | XFreeStringList (cl); |
2735 | } |
2735 | } |
2736 | else |
2736 | else |
2737 | paste (ct.value, ct.nitems); // paste raw |
2737 | paste ((char *)ct.value, ct.nitems); // paste raw |
2738 | |
2738 | |
2739 | bailout: |
2739 | bailout: |
2740 | XFree (ct.value); |
2740 | XFree (ct.value); |
2741 | |
2741 | |
2742 | if (selection_wait == Sel_normal) |
2742 | if (selection_wait == Sel_normal) |
… | |
… | |
2780 | return; /* outside window */ |
2780 | return; /* outside window */ |
2781 | |
2781 | |
2782 | if (selection.text) |
2782 | if (selection.text) |
2783 | { /* internal selection */ |
2783 | { /* internal selection */ |
2784 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2784 | char *str = rxvt_wcstombs (selection.text, selection.len); |
2785 | paste ((unsigned char *)str, strlen (str)); |
2785 | paste (str, strlen (str)); |
2786 | free (str); |
2786 | free (str); |
2787 | return; |
2787 | return; |
2788 | } |
2788 | } |
2789 | else |
2789 | else |
2790 | { |
2790 | { |