… | |
… | |
59 | #if ENABLE_EWMH |
59 | #if ENABLE_EWMH |
60 | "_NET_WM_PID", |
60 | "_NET_WM_PID", |
61 | "_NET_WM_NAME", |
61 | "_NET_WM_NAME", |
62 | "_NET_WM_ICON_NAME", |
62 | "_NET_WM_ICON_NAME", |
63 | "_NET_WM_PING", |
63 | "_NET_WM_PING", |
|
|
64 | "_NET_WM_ICON", |
64 | #endif |
65 | #endif |
65 | #if USE_XIM |
66 | #if USE_XIM |
66 | "WM_LOCALE_NAME", |
67 | "WM_LOCALE_NAME", |
67 | "XIM_SERVERS", |
68 | "XIM_SERVERS", |
68 | #endif |
69 | #endif |
… | |
… | |
543 | } |
544 | } |
544 | #endif |
545 | #endif |
545 | |
546 | |
546 | void rxvt_display::x_cb (ev::io &w, int revents) |
547 | void rxvt_display::x_cb (ev::io &w, int revents) |
547 | { |
548 | { |
|
|
549 | flush_ev.start (); |
|
|
550 | } |
|
|
551 | |
|
|
552 | void rxvt_display::flush_cb (ev::prepare &w, int revents) |
|
|
553 | { |
548 | while (XEventsQueued (dpy, QueuedAfterReading)) |
554 | while (XEventsQueued (dpy, QueuedAfterFlush)) |
|
|
555 | do |
549 | { |
556 | { |
550 | XEvent xev; |
557 | XEvent xev; |
551 | XNextEvent (dpy, &xev); |
558 | XNextEvent (dpy, &xev); |
552 | |
|
|
553 | flush_ev.start (); |
|
|
554 | |
559 | |
555 | #ifdef USE_XIM |
560 | #ifdef USE_XIM |
556 | if (!XFilterEvent (&xev, None)) |
561 | if (!XFilterEvent (&xev, None)) |
557 | #endif |
|
|
558 | { |
562 | { |
559 | if (xev.type == PropertyNotify |
563 | if (xev.type == PropertyNotify |
560 | && xev.xany.window == root |
564 | && xev.xany.window == root |
561 | && xev.xproperty.atom == xa[XA_XIM_SERVERS]) |
565 | && xev.xproperty.atom == xa[XA_XIM_SERVERS]) |
562 | im_change_check (); |
566 | im_change_check (); |
|
|
567 | #endif |
563 | if (xev.type == MappingNotify) |
568 | if (xev.type == MappingNotify) |
564 | XRefreshKeyboardMapping (&xev.xmapping); |
569 | XRefreshKeyboardMapping (&xev.xmapping); |
565 | |
570 | |
566 | for (int i = xw.size (); i--; ) |
571 | for (int i = xw.size (); i--; ) |
567 | { |
572 | { |
568 | if (!xw[i]) |
573 | if (!xw[i]) |
569 | xw.erase_unordered (i); |
574 | xw.erase_unordered (i); |
570 | else if (xw[i]->window == xev.xany.window) |
575 | else if (xw[i]->window == xev.xany.window) |
571 | xw[i]->call (xev); |
576 | xw[i]->call (xev); |
572 | } |
577 | } |
|
|
578 | #ifdef USE_XIM |
573 | } |
579 | } |
|
|
580 | #endif |
574 | } |
581 | } |
|
|
582 | while (XEventsQueued (dpy, QueuedAlready)); |
575 | |
583 | |
576 | XFlush (dpy); |
|
|
577 | } |
|
|
578 | |
|
|
579 | void rxvt_display::flush_cb (ev::idle &w, int revents) |
|
|
580 | { |
|
|
581 | w.stop (); |
584 | w.stop (); |
582 | XFlush (dpy); |
|
|
583 | } |
585 | } |
584 | |
586 | |
585 | void rxvt_display::reg (xevent_watcher *w) |
587 | void rxvt_display::reg (xevent_watcher *w) |
586 | { |
588 | { |
587 | if (!w->active) |
589 | if (!w->active) |