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

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.127 by sf-exg, Mon May 30 18:39:03 2011 UTC vs.
Revision 1.130 by sf-exg, Fri Jan 13 12:40:53 2012 UTC

686 686
687bool 687bool
688rxvt_color::alloc (rxvt_screen *screen, const rgba &color) 688rxvt_color::alloc (rxvt_screen *screen, const rgba &color)
689{ 689{
690 //TODO: only supports 24 bit 690 //TODO: only supports 24 bit
691 int alpha = color.a >= 0xff00 ? 0xffff : color.a; 691 unsigned int alpha = color.a >= 0xff00 ? 0xffff : color.a;
692 692
693#if XFT 693#if XFT
694 XRenderPictFormat *format; 694 XRenderPictFormat *format;
695 695
696 // FUCKING Xft gets it wrong, of course, so work around it. 696 // FUCKING Xft gets it wrong, of course, so work around it.
725 d.red = color.r; 725 d.red = color.r;
726 d.green = color.g; 726 d.green = color.g;
727 d.blue = color.b; 727 d.blue = color.b;
728 d.alpha = alpha; 728 d.alpha = alpha;
729 729
730 return XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c); 730 if (XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c))
731 return true;
731 } 732 }
732#else 733#else
733 c.red = color.r; 734 c.red = color.r;
734 c.green = color.g; 735 c.green = color.g;
735 c.blue = color.b; 736 c.blue = color.b;
742 743
743 return true; 744 return true;
744 } 745 }
745 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 746 else if (XAllocColor (screen->dpy, screen->cmap, &c))
746 return true; 747 return true;
747 else 748#endif
749
748 c.pixel = (color.r + color.g + color.b) > 128*3 750 c.pixel = (color.r + color.g + color.b) > 128*3
749 ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy)) 751 ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy))
750 : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy)); 752 : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy));
751#endif
752 753
753 return false; 754 return false;
754} 755}
755 756
756bool 757bool
911 912
912 incr_buf = 0; 913 incr_buf = 0;
913 incr_buf_size = incr_buf_fill = 0; 914 incr_buf_size = incr_buf_fill = 0;
914 selection_wait = Sel_normal; 915 selection_wait = Sel_normal;
915 selection_type = selnum; 916 selection_type = selnum;
917 cb_sv = 0;
916} 918}
917 919
918void 920void
919rxvt_selection::stop () 921rxvt_selection::stop ()
920{ 922{
960} 962}
961 963
962void 964void
963rxvt_selection::finish (char *data, unsigned int len) 965rxvt_selection::finish (char *data, unsigned int len)
964{ 966{
965 if (term) 967 if (!cb_sv)
966 { 968 {
967 if (data) 969 if (data)
968 term->paste (data, len); 970 term->paste (data, len);
969 971
970 term->selection_req = 0; 972 term->selection_req = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines