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.90 by root, Wed Jan 23 14:09:21 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 { 562 {
556 if (xev.type == PropertyNotify 563 if (xev.type == PropertyNotify
557 && xev.xany.window == root 564 && xev.xany.window == root
558 && xev.xproperty.atom == xa[XA_XIM_SERVERS]) 565 && xev.xproperty.atom == xa[XA_XIM_SERVERS])
559 im_change_check (); 566 im_change_check ();
560#endif 567#endif
561 if (xev.type == MappingNotify) 568 if (xev.type == MappingNotify)
562 XRefreshKeyboardMapping (&xev.xmapping); 569 XRefreshKeyboardMapping (&xev.xmapping);
563 570
564 for (int i = xw.size (); i--; ) 571 for (int i = xw.size (); i--; )
565 { 572 {
566 if (!xw[i]) 573 if (!xw[i])
567 xw.erase_unordered (i); 574 xw.erase_unordered (i);
568 else if (xw[i]->window == xev.xany.window) 575 else if (xw[i]->window == xev.xany.window)
569 xw[i]->call (xev); 576 xw[i]->call (xev);
570 } 577 }
571#ifdef USE_XIM 578#ifdef USE_XIM
572 } 579 }
573#endif 580#endif
574 } 581 }
575} 582 while (XEventsQueued (dpy, QueuedAlready));
576 583
577void rxvt_display::flush_cb (ev::prepare &w, int revents)
578{
579 w.stop (); 584 w.stop ();
580 XFlush (dpy);
581} 585}
582 586
583void rxvt_display::reg (xevent_watcher *w) 587void rxvt_display::reg (xevent_watcher *w)
584{ 588{
585 if (!w->active) 589 if (!w->active)
716 c.green = color.g; 720 c.green = color.g;
717 c.blue = color.b; 721 c.blue = color.b;
718 722
719 if (screen->visual->c_class == TrueColor) 723 if (screen->visual->c_class == TrueColor)
720 { 724 {
721 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 ))
722 | (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))
723 | (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 ));
724 728
725 return true; 729 return true;
726 } 730 }
727 else if (XAllocColor (screen->dpy, screen->cmap, &c)) 731 else if (XAllocColor (screen->dpy, screen->cmap, &c))
728 return true; 732 return true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines