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.60 by root, Wed Jul 5 20:37:31 2006 UTC vs.
Revision 1.64 by root, Mon Feb 12 19:26:10 2007 UTC

579 XFlush (dpy); 579 XFlush (dpy);
580} 580}
581 581
582void rxvt_display::reg (xevent_watcher *w) 582void rxvt_display::reg (xevent_watcher *w)
583{ 583{
584 if (!w->active)
585 {
584 xw.push_back (w); 586 xw.push_back (w);
585 w->active = xw.size (); 587 w->active = xw.size ();
588 }
586} 589}
587 590
588void rxvt_display::unreg (xevent_watcher *w) 591void rxvt_display::unreg (xevent_watcher *w)
589{ 592{
590 if (w->active) 593 if (w->active)
594 {
591 xw[w->active - 1] = 0; 595 xw[w->active - 1] = 0;
596 w->active = 0;
597 }
592} 598}
593 599
594void rxvt_display::set_selection_owner (rxvt_term *owner) 600void rxvt_display::set_selection_owner (rxvt_term *owner)
595{ 601{
596 if (selection_owner && selection_owner != owner) 602 if (selection_owner && selection_owner != owner)
701 c.green = color.g; 707 c.green = color.g;
702 c.blue = color.b; 708 c.blue = color.b;
703 709
704 if (screen->visual->c_class == TrueColor) 710 if (screen->visual->c_class == TrueColor)
705 { 711 {
706 c.pixel = (color.r * (screen->visual->red_mask >> ctz (screen->visual->red_mask )) 712 c.pixel = (color.r >> (16 - popcount (screen->visual->red_mask )) << ctz (screen->visual->red_mask ))
707 / rgba::MAX_CC) << ctz (screen->visual->red_mask ) 713 | (color.g >> (16 - popcount (screen->visual->green_mask)) << ctz (screen->visual->green_mask))
708 | (color.g * (screen->visual->green_mask >> ctz (screen->visual->green_mask))
709 / rgba::MAX_CC) << ctz (screen->visual->green_mask)
710 | (color.b * (screen->visual->blue_mask >> ctz (screen->visual->blue_mask )) 714 | (color.b >> (16 - popcount (screen->visual->blue_mask )) << ctz (screen->visual->blue_mask ));
711 / rgba::MAX_CC) << ctz (screen->visual->blue_mask );
712 715
713 return true; 716 return true;
714 } 717 }
715 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 718 else if (XAllocColor (screen->dpy, screen->cmap, &c))
716 return true; 719 return true;
803 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", 806 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n",
804 // color.r, color.g, color.b, best->red, best->green, best->blue, diff); 807 // color.r, color.g, color.b, best->red, best->green, best->blue, diff);
805 808
806 got = alloc (screen, rgba (best->red, best->green, best->blue)); 809 got = alloc (screen, rgba (best->red, best->green, best->blue));
807 810
808 delete colors; 811 delete [] colors;
809 } 812 }
810#endif 813#endif
811 814
812 return got; 815 return got;
813} 816}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines