… | |
… | |
550 | XEvent xev; |
550 | XEvent xev; |
551 | XNextEvent (dpy, &xev); |
551 | XNextEvent (dpy, &xev); |
552 | |
552 | |
553 | #ifdef USE_XIM |
553 | #ifdef USE_XIM |
554 | if (!XFilterEvent (&xev, None)) |
554 | if (!XFilterEvent (&xev, None)) |
555 | #endif |
|
|
556 | { |
555 | { |
557 | if (xev.type == PropertyNotify |
556 | if (xev.type == PropertyNotify |
558 | && xev.xany.window == root |
557 | && xev.xany.window == root |
559 | && xev.xproperty.atom == xa[XA_XIM_SERVERS]) |
558 | && xev.xproperty.atom == xa[XA_XIM_SERVERS]) |
560 | im_change_check (); |
559 | im_change_check (); |
561 | |
560 | #endif |
562 | if (xev.type == MappingNotify) |
561 | if (xev.type == MappingNotify) |
563 | XRefreshKeyboardMapping (&xev.xmapping); |
562 | XRefreshKeyboardMapping (&xev.xmapping); |
564 | |
563 | |
565 | for (int i = xw.size (); i--; ) |
564 | for (int i = xw.size (); i--; ) |
566 | { |
565 | { |
567 | if (!xw[i]) |
566 | if (!xw[i]) |
568 | xw.erase_unordered (i); |
567 | xw.erase_unordered (i); |
569 | else if (xw[i]->window == xev.xany.window) |
568 | else if (xw[i]->window == xev.xany.window) |
570 | xw[i]->call (xev); |
569 | xw[i]->call (xev); |
571 | } |
570 | } |
|
|
571 | #ifdef USE_XIM |
572 | } |
572 | } |
|
|
573 | #endif |
573 | } |
574 | } |
574 | } |
575 | } |
575 | |
576 | |
576 | void rxvt_display::flush_cb (ev::prepare &w, int revents) |
577 | void rxvt_display::flush_cb (ev::prepare &w, int revents) |
577 | { |
578 | { |
|
|
579 | while (XEventsQueued (dpy, QueuedAfterFlush)) |
|
|
580 | x_cb (x_ev, EV_READ); |
|
|
581 | |
578 | w.stop (); |
582 | w.stop (); |
579 | XFlush (dpy); |
|
|
580 | } |
583 | } |
581 | |
584 | |
582 | void rxvt_display::reg (xevent_watcher *w) |
585 | void rxvt_display::reg (xevent_watcher *w) |
583 | { |
586 | { |
584 | if (!w->active) |
587 | if (!w->active) |