… | |
… | |
540 | } |
540 | } |
541 | #endif |
541 | #endif |
542 | |
542 | |
543 | void rxvt_display::x_cb (ev::io &w, int revents) |
543 | void rxvt_display::x_cb (ev::io &w, int revents) |
544 | { |
544 | { |
545 | do |
545 | while (XEventsQueued (dpy, QueuedAfterReading)) |
546 | { |
546 | { |
547 | XEvent xev; |
547 | XEvent xev; |
548 | XNextEvent (dpy, &xev); |
548 | XNextEvent (dpy, &xev); |
549 | |
549 | |
550 | #ifdef USE_XIM |
550 | #ifdef USE_XIM |
… | |
… | |
567 | } |
567 | } |
568 | #ifdef USE_XIM |
568 | #ifdef USE_XIM |
569 | } |
569 | } |
570 | #endif |
570 | #endif |
571 | } |
571 | } |
572 | while (XEventsQueued (dpy, QueuedAlready)); |
|
|
573 | |
572 | |
574 | XFlush (dpy); |
573 | XFlush (dpy); |
575 | } |
574 | } |
576 | |
575 | |
577 | void rxvt_display::flush () |
576 | void rxvt_display::flush () |
578 | { |
577 | { |
579 | if (XEventsQueued (dpy, QueuedAlready)) |
|
|
580 | x_cb (x_ev, ev::READ); |
578 | x_cb (x_ev, ev::READ); |
581 | |
|
|
582 | XFlush (dpy); |
|
|
583 | } |
579 | } |
584 | |
580 | |
585 | void rxvt_display::reg (xevent_watcher *w) |
581 | void rxvt_display::reg (xevent_watcher *w) |
586 | { |
582 | { |
587 | if (!w->active) |
583 | if (!w->active) |
… | |
… | |
886 | lerp (c.a, to.a, percent) |
882 | lerp (c.a, to.a, percent) |
887 | ) |
883 | ) |
888 | ); |
884 | ); |
889 | } |
885 | } |
890 | |
886 | |
|
|
887 | #if TRACE_PIXMAPS |
|
|
888 | # undef XCreatePixmap |
|
|
889 | # undef XFreePixmap |
|
|
890 | Pixmap trace_XCreatePixmap (const char *file, int line, Display *dpy, Window r, unsigned int w, unsigned int h, unsigned int d) |
|
|
891 | { |
|
|
892 | Pixmap res = XCreatePixmap (dpy, r, w, h, d); |
|
|
893 | fprintf (stderr, "%s:%d: XCreatePixmap (%p,%lX,%u,%u,%u) returned %lX\n", file, line, dpy, r, w, h, d, res); |
|
|
894 | return res; |
|
|
895 | } |
|
|
896 | |
|
|
897 | void trace_XFreePixmap (const char *file, int line, Display *dpy, Pixmap p) |
|
|
898 | { |
|
|
899 | fprintf (stderr, "%s:%d: XFreePixmap (%p,%lX)\n", file, line, dpy, p); |
|
|
900 | XFreePixmap (dpy,p); |
|
|
901 | } |
|
|
902 | #endif |