… | |
… | |
471 | socklen_t sl = sizeof (sa); |
471 | socklen_t sl = sizeof (sa); |
472 | |
472 | |
473 | if (!getsockname (fd, (sockaddr *)&sa, &sl)) |
473 | if (!getsockname (fd, (sockaddr *)&sa, &sl)) |
474 | is_local = sa.sun_family == AF_UNIX; |
474 | is_local = sa.sun_family == AF_UNIX; |
475 | |
475 | |
476 | x_ev.start (fd, EVENT_READ); |
476 | x_ev.start (fd, ev::READ); |
477 | fcntl (fd, F_SETFD, FD_CLOEXEC); |
477 | fcntl (fd, F_SETFD, FD_CLOEXEC); |
478 | |
478 | |
479 | XSelectInput (dpy, root, PropertyChangeMask); |
479 | XSelectInput (dpy, root, PropertyChangeMask); |
480 | |
480 | |
481 | flush (); |
481 | flush (); |
… | |
… | |
538 | |
538 | |
539 | XFree (atoms); |
539 | XFree (atoms); |
540 | } |
540 | } |
541 | #endif |
541 | #endif |
542 | |
542 | |
543 | void rxvt_display::x_cb (io_watcher &w, short revents) |
543 | void rxvt_display::x_cb (ev::io &w, int revents) |
544 | { |
544 | { |
545 | do |
545 | do |
546 | { |
546 | { |
547 | XEvent xev; |
547 | XEvent xev; |
548 | XNextEvent (dpy, &xev); |
548 | XNextEvent (dpy, &xev); |
… | |
… | |
575 | } |
575 | } |
576 | |
576 | |
577 | void rxvt_display::flush () |
577 | void rxvt_display::flush () |
578 | { |
578 | { |
579 | if (XEventsQueued (dpy, QueuedAlready)) |
579 | if (XEventsQueued (dpy, QueuedAlready)) |
580 | x_cb (x_ev, EVENT_READ); |
580 | x_cb (x_ev, ev::READ); |
581 | |
581 | |
582 | XFlush (dpy); |
582 | XFlush (dpy); |
583 | } |
583 | } |
584 | |
584 | |
585 | void rxvt_display::reg (xevent_watcher *w) |
585 | void rxvt_display::reg (xevent_watcher *w) |