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.61 by root, Mon Aug 7 15:12:48 2006 UTC vs.
Revision 1.67 by ayin, Mon Jun 25 23:27:18 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),
451 XVisualIDFromVisual (DefaultVisual (dpy, screen)), None, NULL);
452#endif
453
448 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); 454 assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
449 XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa); 455 XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa);
450 456
451 XrmSetDatabase (dpy, get_resources (false)); 457 XrmSetDatabase (dpy, get_resources (false));
452 458
469 is_local = 0; 475 is_local = 0;
470 sockaddr_un sa; 476 sockaddr_un sa;
471 socklen_t sl = sizeof (sa); 477 socklen_t sl = sizeof (sa);
472 478
473 if (!getsockname (fd, (sockaddr *)&sa, &sl)) 479 if (!getsockname (fd, (sockaddr *)&sa, &sl))
474 is_local = sa.sun_family == AF_LOCAL; 480 is_local = sa.sun_family == AF_UNIX;
475 481
476 x_ev.start (fd, EVENT_READ); 482 x_ev.start (fd, EVENT_READ);
477 fcntl (fd, F_SETFD, FD_CLOEXEC); 483 fcntl (fd, F_SETFD, FD_CLOEXEC);
478 484
479 XSelectInput (dpy, root, PropertyChangeMask); 485 XSelectInput (dpy, root, PropertyChangeMask);
579 XFlush (dpy); 585 XFlush (dpy);
580} 586}
581 587
582void rxvt_display::reg (xevent_watcher *w) 588void rxvt_display::reg (xevent_watcher *w)
583{ 589{
584 if (!w.active) 590 if (!w->active)
585 { 591 {
586 xw.push_back (w); 592 xw.push_back (w);
587 w->active = xw.size (); 593 w->active = xw.size ();
588 } 594 }
589} 595}
707 c.green = color.g; 713 c.green = color.g;
708 c.blue = color.b; 714 c.blue = color.b;
709 715
710 if (screen->visual->c_class == TrueColor) 716 if (screen->visual->c_class == TrueColor)
711 { 717 {
712 c.pixel = (color.r * (screen->visual->red_mask >> ctz (screen->visual->red_mask )) 718 c.pixel = (color.r >> (16 - popcount (screen->visual->red_mask )) << ctz (screen->visual->red_mask ))
713 / rgba::MAX_CC) << ctz (screen->visual->red_mask ) 719 | (color.g >> (16 - popcount (screen->visual->green_mask)) << ctz (screen->visual->green_mask))
714 | (color.g * (screen->visual->green_mask >> ctz (screen->visual->green_mask))
715 / rgba::MAX_CC) << ctz (screen->visual->green_mask)
716 | (color.b * (screen->visual->blue_mask >> ctz (screen->visual->blue_mask )) 720 | (color.b >> (16 - popcount (screen->visual->blue_mask )) << ctz (screen->visual->blue_mask ));
717 / rgba::MAX_CC) << ctz (screen->visual->blue_mask );
718 721
719 return true; 722 return true;
720 } 723 }
721 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 724 else if (XAllocColor (screen->dpy, screen->cmap, &c))
722 return true; 725 return true;
809 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", 812 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n",
810 // color.r, color.g, color.b, best->red, best->green, best->blue, diff); 813 // color.r, color.g, color.b, best->red, best->green, best->blue, diff);
811 814
812 got = alloc (screen, rgba (best->red, best->green, best->blue)); 815 got = alloc (screen, rgba (best->red, best->green, best->blue));
813 816
814 delete colors; 817 delete [] colors;
815 } 818 }
816#endif 819#endif
817 820
818 return got; 821 return got;
819} 822}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines