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.70 by sasha, Thu Jul 12 22:33:16 2007 UTC

64#endif 64#endif
65#if USE_XIM 65#if USE_XIM
66 "WM_LOCALE_NAME", 66 "WM_LOCALE_NAME",
67 "XIM_SERVERS", 67 "XIM_SERVERS",
68#endif 68#endif
69#ifdef TRANSPARENT 69#ifdef ENABLE_TRANSPARENCY
70 "_XROOTPMAP_ID", 70 "_XROOTPMAP_ID",
71 "ESETROOT_PMAP_ID", 71 "ESETROOT_PMAP_ID",
72#endif 72#endif
73#if ENABLE_XEMBED 73#if ENABLE_XEMBED
74 "_XEMBED", 74 "_XEMBED",
469 is_local = 0; 469 is_local = 0;
470 sockaddr_un sa; 470 sockaddr_un sa;
471 socklen_t sl = sizeof (sa); 471 socklen_t sl = sizeof (sa);
472 472
473 if (!getsockname (fd, (sockaddr *)&sa, &sl)) 473 if (!getsockname (fd, (sockaddr *)&sa, &sl))
474 is_local = sa.sun_family == AF_LOCAL; 474 is_local = sa.sun_family == AF_UNIX;
475 475
476 x_ev.start (fd, EVENT_READ); 476 x_ev.start (fd, EVENT_READ);
477 fcntl (fd, F_SETFD, FD_CLOEXEC); 477 fcntl (fd, F_SETFD, FD_CLOEXEC);
478 478
479 XSelectInput (dpy, root, PropertyChangeMask); 479 XSelectInput (dpy, root, PropertyChangeMask);
553 if (xev.type == PropertyNotify 553 if (xev.type == PropertyNotify
554 && xev.xany.window == root 554 && xev.xany.window == root
555 && xev.xproperty.atom == xa[XA_XIM_SERVERS]) 555 && xev.xproperty.atom == xa[XA_XIM_SERVERS])
556 im_change_check (); 556 im_change_check ();
557#endif 557#endif
558 if (xev.type == MappingNotify)
559 XRefreshKeyboardMapping (&xev.xmapping);
560
558 for (int i = xw.size (); i--; ) 561 for (int i = xw.size (); i--; )
559 { 562 {
560 if (!xw[i]) 563 if (!xw[i])
561 xw.erase_unordered (i); 564 xw.erase_unordered (i);
562 else if (xw[i]->window == xev.xany.window) 565 else if (xw[i]->window == xev.xany.window)
579 XFlush (dpy); 582 XFlush (dpy);
580} 583}
581 584
582void rxvt_display::reg (xevent_watcher *w) 585void rxvt_display::reg (xevent_watcher *w)
583{ 586{
587 if (!w->active)
588 {
584 xw.push_back (w); 589 xw.push_back (w);
585 w->active = xw.size (); 590 w->active = xw.size ();
591 }
586} 592}
587 593
588void rxvt_display::unreg (xevent_watcher *w) 594void rxvt_display::unreg (xevent_watcher *w)
589{ 595{
590 if (w->active) 596 if (w->active)
597 {
591 xw[w->active - 1] = 0; 598 xw[w->active - 1] = 0;
599 w->active = 0;
600 }
592} 601}
593 602
594void rxvt_display::set_selection_owner (rxvt_term *owner) 603void rxvt_display::set_selection_owner (rxvt_term *owner)
595{ 604{
596 if (selection_owner && selection_owner != owner) 605 if (selection_owner && selection_owner != owner)
701 c.green = color.g; 710 c.green = color.g;
702 c.blue = color.b; 711 c.blue = color.b;
703 712
704 if (screen->visual->c_class == TrueColor) 713 if (screen->visual->c_class == TrueColor)
705 { 714 {
706 c.pixel = (color.r * (screen->visual->red_mask >> ctz (screen->visual->red_mask )) 715 c.pixel = (color.r >> (16 - popcount (screen->visual->red_mask )) << ctz (screen->visual->red_mask ))
707 / rgba::MAX_CC) << ctz (screen->visual->red_mask ) 716 | (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 )) 717 | (color.b >> (16 - popcount (screen->visual->blue_mask )) << ctz (screen->visual->blue_mask ));
711 / rgba::MAX_CC) << ctz (screen->visual->blue_mask );
712 718
713 return true; 719 return true;
714 } 720 }
715 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 721 else if (XAllocColor (screen->dpy, screen->cmap, &c))
716 return true; 722 return true;
803 //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", 809 //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); 810 // color.r, color.g, color.b, best->red, best->green, best->blue, diff);
805 811
806 got = alloc (screen, rgba (best->red, best->green, best->blue)); 812 got = alloc (screen, rgba (best->red, best->green, best->blue));
807 813
808 delete colors; 814 delete [] colors;
809 } 815 }
810#endif 816#endif
811 817
812 return got; 818 return got;
813} 819}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines