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.94 by root, Sat Jan 26 11:37:51 2008 UTC vs.
Revision 1.103 by root, Fri Sep 4 15:40:13 2009 UTC

59#if ENABLE_EWMH 59#if ENABLE_EWMH
60 "_NET_WM_PID", 60 "_NET_WM_PID",
61 "_NET_WM_NAME", 61 "_NET_WM_NAME",
62 "_NET_WM_ICON_NAME", 62 "_NET_WM_ICON_NAME",
63 "_NET_WM_PING", 63 "_NET_WM_PING",
64 "_NET_WM_ICON",
64#endif 65#endif
65#if USE_XIM 66#if USE_XIM
66 "WM_LOCALE_NAME", 67 "WM_LOCALE_NAME",
67 "XIM_SERVERS", 68 "XIM_SERVERS",
68#endif 69#endif
543} 544}
544#endif 545#endif
545 546
546void rxvt_display::x_cb (ev::io &w, int revents) 547void rxvt_display::x_cb (ev::io &w, int revents)
547{ 548{
549 flush_ev.start ();
550}
551
552void rxvt_display::flush_cb (ev::prepare &w, int revents)
553{
548 while (XEventsQueued (dpy, QueuedAfterReading)) 554 while (XEventsQueued (dpy, QueuedAfterFlush))
555 do
549 { 556 {
550 XEvent xev; 557 XEvent xev;
551 XNextEvent (dpy, &xev); 558 XNextEvent (dpy, &xev);
552 559
553#ifdef USE_XIM 560#ifdef USE_XIM
554 if (!XFilterEvent (&xev, None)) 561 if (!XFilterEvent (&xev, None))
555#endif
556 { 562 {
557 if (xev.type == PropertyNotify 563 if (xev.type == PropertyNotify
558 && xev.xany.window == root 564 && xev.xany.window == root
559 && xev.xproperty.atom == xa[XA_XIM_SERVERS]) 565 && xev.xproperty.atom == xa[XA_XIM_SERVERS])
560 im_change_check (); 566 im_change_check ();
561 567#endif
562 if (xev.type == MappingNotify) 568 if (xev.type == MappingNotify)
563 XRefreshKeyboardMapping (&xev.xmapping); 569 XRefreshKeyboardMapping (&xev.xmapping);
564 570
565 for (int i = xw.size (); i--; ) 571 for (int i = xw.size (); i--; )
566 { 572 {
567 if (!xw[i]) 573 if (!xw[i])
568 xw.erase_unordered (i); 574 xw.erase_unordered (i);
569 else if (xw[i]->window == xev.xany.window) 575 else if (xw[i]->window == xev.xany.window)
570 xw[i]->call (xev); 576 xw[i]->call (xev);
571 } 577 }
578#ifdef USE_XIM
572 } 579 }
580#endif
573 } 581 }
574} 582 while (XEventsQueued (dpy, QueuedAlready));
575 583
576void rxvt_display::flush_cb (ev::prepare &w, int revents)
577{
578 w.stop (); 584 w.stop ();
579 XFlush (dpy);
580} 585}
581 586
582void rxvt_display::reg (xevent_watcher *w) 587void rxvt_display::reg (xevent_watcher *w)
583{ 588{
584 if (!w->active) 589 if (!w->active)
715 c.green = color.g; 720 c.green = color.g;
716 c.blue = color.b; 721 c.blue = color.b;
717 722
718 if (screen->visual->c_class == TrueColor) 723 if (screen->visual->c_class == TrueColor)
719 { 724 {
720 c.pixel = (color.r >> (16 - popcount (screen->visual->red_mask )) << ctz (screen->visual->red_mask )) 725 c.pixel = (color.r >> (16 - rxvt_popcount (screen->visual->red_mask )) << rxvt_ctz (screen->visual->red_mask ))
721 | (color.g >> (16 - popcount (screen->visual->green_mask)) << ctz (screen->visual->green_mask)) 726 | (color.g >> (16 - rxvt_popcount (screen->visual->green_mask)) << rxvt_ctz (screen->visual->green_mask))
722 | (color.b >> (16 - popcount (screen->visual->blue_mask )) << ctz (screen->visual->blue_mask )); 727 | (color.b >> (16 - rxvt_popcount (screen->visual->blue_mask )) << rxvt_ctz (screen->visual->blue_mask ));
723 728
724 return true; 729 return true;
725 } 730 }
726 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 731 else if (XAllocColor (screen->dpy, screen->cmap, &c))
727 return true; 732 return true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines