diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-03-15 12:37:56 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-03-15 12:37:56 +0000 |
| commit | 6eeea06cc0525f9f0d2548ebf685b15f257142b6 (patch) | |
| tree | 9bc76d23ba383e7f4aa1c3ac7c1c0bc7a19199c4 | |
| parent | wayland: store display FD in wayland struct (diff) | |
wayland: add FDs to FDM as soon as the FDs are ready
| -rw-r--r-- | wayland.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -851,20 +851,20 @@ wayl_init(const struct config *conf, struct fdm *fdm) goto out; } + if (!fdm_add(fdm, wayl->fd, EPOLLIN, &fdm_wayl, wayl)) + goto out; + wayl->kbd.repeat.fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK); if (wayl->kbd.repeat.fd == -1) { LOG_ERRNO("failed to create keyboard repeat timer FD"); goto out; } - if (wl_display_prepare_read(wayl->display) != 0) { - LOG_ERRNO("failed to prepare for reading wayland events"); + if (!fdm_add(fdm, wayl->kbd.repeat.fd, EPOLLIN, &fdm_repeat, wayl)) goto out; - } - if (!fdm_add(fdm, wl_display_get_fd(wayl->display), EPOLLIN, &fdm_wayl, wayl) || - !fdm_add(fdm, wayl->kbd.repeat.fd, EPOLLIN, &fdm_repeat, wayl)) - { + if (wl_display_prepare_read(wayl->display) != 0) { + LOG_ERRNO("failed to prepare for reading wayland events"); goto out; } |
