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