--- rxvt-unicode/src/rxvttoolkit.C 2007/11/11 04:08:00 1.75 +++ rxvt-unicode/src/rxvttoolkit.C 2007/11/23 07:59:14 1.78 @@ -464,7 +464,7 @@ int fd = XConnectionNumber (dpy); // try to detect wether we have a local connection. - // assume unix domains socket == local, everything else not + // assume unix domain socket == local, everything else not // TODO: might want to check for inet/127.0.0.1 is_local = 0; sockaddr_un sa; @@ -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