--- rxvt-unicode/src/rxvttoolkit.C 2007/11/11 18:05:19 1.76 +++ rxvt-unicode/src/rxvttoolkit.C 2007/11/23 07:59:14 1.78 @@ -542,7 +542,7 @@ void rxvt_display::x_cb (ev::io &w, int revents) { - do + while (XEventsQueued (dpy, QueuedAfterReading)) { XEvent xev; XNextEvent (dpy, &xev); @@ -569,17 +569,13 @@ } #endif } - while (XEventsQueued (dpy, QueuedAlready)); XFlush (dpy); } void rxvt_display::flush () { - if (XEventsQueued (dpy, QueuedAlready)) - x_cb (x_ev, ev::READ); - - XFlush (dpy); + x_cb (x_ev, ev::READ); } void rxvt_display::reg (xevent_watcher *w) @@ -888,3 +884,19 @@ ); } +#if TRACE_PIXMAPS +# undef XCreatePixmap +# undef XFreePixmap +Pixmap trace_XCreatePixmap (const char *file, int line, Display *dpy, Window r, unsigned int w, unsigned int h, unsigned int d) +{ + Pixmap res = XCreatePixmap (dpy, r, w, h, d); + fprintf (stderr, "%s:%d: XCreatePixmap (%p,%lX,%u,%u,%u) returned %lX\n", file, line, dpy, r, w, h, d, res); + return res; +} + +void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p) +{ + fprintf (stderr, "%s:%d: XFreePixmap (%p,%lX)\n", file, line, dpy, p); + XFreePixmap (dpy,p); +} +#endif