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.367 by sf-exg, Mon Jan 31 15:40:22 2011 UTC vs.
Revision 1.369 by sf-exg, Sun Feb 6 11:42:03 2011 UTC

38 while (len--) 38 while (len--)
39 *start++ = value; 39 *start++ = value;
40} 40}
41 41
42/* ------------------------------------------------------------------------- */ 42/* ------------------------------------------------------------------------- */
43#define PROP_SIZE 256*1024
44#define PASTE_SIZE 32768
45#define TABSIZE 8 /* default tab size */ 43#define TABSIZE 8 /* default tab size */
46 44
47/* ------------------------------------------------------------------------- * 45/* ------------------------------------------------------------------------- *
48 * GENERAL SCREEN AND SELECTION UPDATE ROUTINES * 46 * GENERAL SCREEN AND SELECTION UPDATE ROUTINES *
49 * ------------------------------------------------------------------------- */ 47 * ------------------------------------------------------------------------- */
2765 } 2763 }
2766 2764
2767 unsigned long bytes_after; 2765 unsigned long bytes_after;
2768 XTextProperty ct; 2766 XTextProperty ct;
2769 2767
2768 // length == (2^31 - 1) / 4, as gdk
2770 if (XGetWindowProperty (dpy, win, prop, 2769 if (XGetWindowProperty (dpy, win, prop,
2771 0, PROP_SIZE / 4, 2770 0, 0x1fffffff,
2772 delete_prop, AnyPropertyType, 2771 delete_prop, AnyPropertyType,
2773 &ct.encoding, &ct.format, 2772 &ct.encoding, &ct.format,
2774 &ct.nitems, &bytes_after, 2773 &ct.nitems, &bytes_after,
2775 &ct.value) != Success) 2774 &ct.value) != Success)
2776 { 2775 {
2778 goto bailout; 2777 goto bailout;
2779 } 2778 }
2780 2779
2781 if (ct.encoding == None) 2780 if (ct.encoding == None)
2782 goto bailout; 2781 goto bailout;
2783
2784 if (bytes_after)
2785 {
2786 // fetch and append remaining data
2787 XTextProperty ct2;
2788
2789 if (XGetWindowProperty (dpy, win, prop,
2790 ct.nitems / 4, (bytes_after + 3) / 4,
2791 delete_prop, AnyPropertyType,
2792 &ct2.encoding, &ct2.format,
2793 &ct2.nitems, &bytes_after,
2794 &ct2.value) != Success)
2795 goto bailout;
2796
2797 // realloc should be compatible to XFree, here, and elsewhere, too
2798 ct.value = (unsigned char *)rxvt_realloc (ct.value, ct.nitems + ct2.nitems + 1);
2799 memcpy (ct.value + ct.nitems, ct2.value, ct2.nitems + 1);
2800 ct.nitems += ct2.nitems;
2801
2802 XFree (ct2.value);
2803 }
2804 2782
2805 if (ct.value == 0) 2783 if (ct.value == 0)
2806 goto bailout; 2784 goto bailout;
2807 2785
2808 if (ct.encoding == xa[XA_INCR]) 2786 if (ct.encoding == xa[XA_INCR])
2839 { 2817 {
2840 /* 2818 /*
2841 * pass through again trying CUT_BUFFER0 if we've come from 2819 * pass through again trying CUT_BUFFER0 if we've come from
2842 * XConvertSelection () but nothing was presented 2820 * XConvertSelection () but nothing was presented
2843 */ 2821 */
2844 selection_paste (display->root, XA_CUT_BUFFER0, False); 2822 selection_paste (display->root, XA_CUT_BUFFER0, false);
2845 } 2823 }
2846 2824
2847 goto bailout; 2825 goto bailout;
2848 } 2826 }
2849 } 2827 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines