--- rxvt-unicode/src/rxvttoolkit.C 2008/01/26 10:15:20 1.92 +++ rxvt-unicode/src/rxvttoolkit.C 2008/01/26 13:31:13 1.100 @@ -550,16 +550,14 @@ XEvent xev; XNextEvent (dpy, &xev); - flush_ev.start (); - #ifdef USE_XIM if (!XFilterEvent (&xev, None)) -#endif { if (xev.type == PropertyNotify && xev.xany.window == root && xev.xproperty.atom == xa[XA_XIM_SERVERS]) im_change_check (); +#endif if (xev.type == MappingNotify) XRefreshKeyboardMapping (&xev.xmapping); @@ -570,16 +568,18 @@ else if (xw[i]->window == xev.xany.window) xw[i]->call (xev); } +#ifdef USE_XIM } +#endif } - - XFlush (dpy); } -void rxvt_display::flush_cb (ev::idle &w, int revents) +void rxvt_display::flush_cb (ev::prepare &w, int revents) { + while (XEventsQueued (dpy, QueuedAfterFlush)) + x_cb (x_ev, EV_READ); + w.stop (); - XFlush (dpy); } void rxvt_display::reg (xevent_watcher *w)