--- rxvt-unicode/src/rxvttoolkit.C 2008/01/26 10:03:35 1.91 +++ rxvt-unicode/src/rxvttoolkit.C 2008/11/04 11:03:29 1.102 @@ -61,6 +61,7 @@ "_NET_WM_NAME", "_NET_WM_ICON_NAME", "_NET_WM_PING", + "_NET_WM_ICON", #endif #if USE_XIM "WM_LOCALE_NAME", @@ -545,39 +546,42 @@ void rxvt_display::x_cb (ev::io &w, int revents) { - while (XEventsQueued (dpy, QueuedAfterReading)) - { - XEvent xev; - XNextEvent (dpy, &xev); + flush_ev.start (); +} - flush_ev.start (); +void rxvt_display::flush_cb (ev::prepare &w, int revents) +{ + while (XEventsQueued (dpy, QueuedAfterFlush)) + do + { + XEvent xev; + XNextEvent (dpy, &xev); #ifdef USE_XIM - if (!XFilterEvent (&xev, None)) + if (!XFilterEvent (&xev, None)) + { + 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); + + for (int i = xw.size (); i--; ) + { + if (!xw[i]) + xw.erase_unordered (i); + else if (xw[i]->window == xev.xany.window) + xw[i]->call (xev); + } +#ifdef USE_XIM + } #endif - { - if (xev.type == PropertyNotify - && xev.xany.window == root - && xev.xproperty.atom == xa[XA_XIM_SERVERS]) - im_change_check (); - if (xev.type == MappingNotify) - XRefreshKeyboardMapping (&xev.xmapping); - - for (int i = xw.size (); i--; ) - { - if (!xw[i]) - xw.erase_unordered (i); - else if (xw[i]->window == xev.xany.window) - xw[i]->call (xev); - } - } - } -} + } + while (XEventsQueued (dpy, QueuedAlready)); -void rxvt_display::flush_cb (ev::prepare &w, int revents) -{ w.stop (); - XFlush (dpy); } void rxvt_display::reg (xevent_watcher *w)