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.65 by sasha, Fri Jun 8 20:04:12 2007 UTC

443 return false; 443 return false;
444 444
445 screen = DefaultScreen (dpy); 445 screen = DefaultScreen (dpy);
446 root = DefaultRootWindow (dpy); 446 root = DefaultRootWindow (dpy);
447 447
448#ifdef HAVE_AFTERIMAGE
449 ::dpy = dpy; /* init global var from libAfter... */
450 asv = create_asvisual_for_id( dpy, screen, DefaultDepth(dpy,screen), XVisualIDFromVisual(DefaultVisual(dpy,screen)), None, NULL );
451#endif
452
448 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); 453 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
449 XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa); 454 XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa);
450 455
451 XrmSetDatabase (dpy, get_resources (false)); 456 XrmSetDatabase (dpy, get_resources (false));
452 457
579 XFlush (dpy); 584 XFlush (dpy);
580} 585}
581 586
582void rxvt_display::reg (xevent_watcher *w) 587void rxvt_display::reg (xevent_watcher *w)
583{ 588{
589 if (!w->active)
590 {
584 xw.push_back (w); 591 xw.push_back (w);
585 w->active = xw.size (); 592 w->active = xw.size ();
593 }
586} 594}
587 595
588void rxvt_display::unreg (xevent_watcher *w) 596void rxvt_display::unreg (xevent_watcher *w)
589{ 597{
590 if (w->active) 598 if (w->active)
599 {
591 xw[w->active - 1] = 0; 600 xw[w->active - 1] = 0;
601 w->active = 0;
602 }
592} 603}
593 604
594void rxvt_display::set_selection_owner (rxvt_term *owner) 605void rxvt_display::set_selection_owner (rxvt_term *owner)
595{ 606{
596 if (selection_owner && selection_owner != owner) 607 if (selection_owner && selection_owner != owner)
701 c.green = color.g; 712 c.green = color.g;
702 c.blue = color.b; 713 c.blue = color.b;
703 714
704 if (screen->visual->c_class == TrueColor) 715 if (screen->visual->c_class == TrueColor)
705 { 716 {
706 c.pixel = (color.r * (screen->visual->red_mask >> ctz (screen->visual->red_mask )) 717 c.pixel = (color.r >> (16 - popcount (screen->visual->red_mask )) << ctz (screen->visual->red_mask ))
707 / rgba::MAX_CC) << ctz (screen->visual->red_mask ) 718 | (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 )) 719 | (color.b >> (16 - popcount (screen->visual->blue_mask )) << ctz (screen->visual->blue_mask ));
711 / rgba::MAX_CC) << ctz (screen->visual->blue_mask );
712 720
713 return true; 721 return true;
714 } 722 }
715 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 723 else if (XAllocColor (screen->dpy, screen->cmap, &c))
716 return true; 724 return true;
803 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", 811 //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); 812 // color.r, color.g, color.b, best->red, best->green, best->blue, diff);
805 813
806 got = alloc (screen, rgba (best->red, best->green, best->blue)); 814 got = alloc (screen, rgba (best->red, best->green, best->blue));
807 815
808 delete colors; 816 delete [] colors;
809 } 817 }
810#endif 818#endif
811 819
812 return got; 820 return got;
813} 821}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines