--- rxvt-unicode/src/rxvttoolkit.C 2008/01/26 10:24:47 1.93 +++ rxvt-unicode/src/rxvttoolkit.C 2008/01/26 12:15:11 1.97 @@ -550,8 +550,6 @@ XEvent xev; XNextEvent (dpy, &xev); - flush_ev.start (); - #ifdef USE_XIM if (!XFilterEvent (&xev, None)) #endif @@ -560,6 +558,7 @@ && xev.xany.window == root && xev.xproperty.atom == xa[XA_XIM_SERVERS]) im_change_check (); + if (xev.type == MappingNotify) XRefreshKeyboardMapping (&xev.xmapping); @@ -572,13 +571,16 @@ } } } - - XFlush (dpy); } -void rxvt_display::flush_cb (ev::idle &w, int revents) +void rxvt_display::flush_cb (ev::prepare &w, int revents) { - XFlush (dpy); + while (XEventsQueued (dpy, QueuedAfterFlush)) + { + x_cb(x_ev,0);//D + } + + w.stop (); } void rxvt_display::reg (xevent_watcher *w)