… | |
… | |
297 | |
297 | |
298 | rxvt_display::rxvt_display (const char *id) |
298 | rxvt_display::rxvt_display (const char *id) |
299 | : refcounted (id) |
299 | : refcounted (id) |
300 | , selection_owner (0) |
300 | , selection_owner (0) |
301 | { |
301 | { |
302 | x_ev.set<rxvt_display, &rxvt_display::x_cb> (this); |
302 | x_ev .set<rxvt_display, &rxvt_display::x_cb > (this); |
|
|
303 | flush_ev.set<rxvt_display, &rxvt_display::flush_cb> (this); |
303 | } |
304 | } |
304 | |
305 | |
305 | XrmDatabase |
306 | XrmDatabase |
306 | rxvt_display::get_resources (bool refresh) |
307 | rxvt_display::get_resources (bool refresh) |
307 | { |
308 | { |
… | |
… | |
471 | socklen_t sl = sizeof (sa); |
472 | socklen_t sl = sizeof (sa); |
472 | |
473 | |
473 | if (!getsockname (fd, (sockaddr *)&sa, &sl)) |
474 | if (!getsockname (fd, (sockaddr *)&sa, &sl)) |
474 | is_local = sa.sun_family == AF_UNIX; |
475 | is_local = sa.sun_family == AF_UNIX; |
475 | |
476 | |
|
|
477 | flush_ev.start (); |
476 | x_ev.start (fd, ev::READ); |
478 | x_ev.start (fd, ev::READ); |
477 | fcntl (fd, F_SETFD, FD_CLOEXEC); |
479 | fcntl (fd, F_SETFD, FD_CLOEXEC); |
478 | |
480 | |
479 | XSelectInput (dpy, root, PropertyChangeMask); |
481 | XSelectInput (dpy, root, PropertyChangeMask); |
480 | |
482 | |
… | |
… | |
567 | } |
569 | } |
568 | #ifdef USE_XIM |
570 | #ifdef USE_XIM |
569 | } |
571 | } |
570 | #endif |
572 | #endif |
571 | } |
573 | } |
|
|
574 | } |
572 | |
575 | |
|
|
576 | void rxvt_display::flush () |
|
|
577 | { |
573 | XFlush (dpy); |
578 | XFlush (dpy); |
574 | } |
579 | } |
575 | |
580 | |
576 | void rxvt_display::flush () |
581 | void rxvt_display::flush_cb (ev::prepare &w, int revents) |
577 | { |
582 | { |
578 | x_cb (x_ev, ev::READ); |
583 | flush (); |
579 | } |
584 | } |
580 | |
585 | |
581 | void rxvt_display::reg (xevent_watcher *w) |
586 | void rxvt_display::reg (xevent_watcher *w) |
582 | { |
587 | { |
583 | if (!w->active) |
588 | if (!w->active) |