mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: add FDs to FDM as soon as the FDs are ready
This commit is contained in:
parent
71fde3bfac
commit
6eeea06cc0
1 changed files with 6 additions and 6 deletions
12
wayland.c
12
wayland.c
|
|
@ -851,23 +851,23 @@ 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 (!fdm_add(fdm, wayl->kbd.repeat.fd, EPOLLIN, &fdm_repeat, wayl))
|
||||
goto out;
|
||||
|
||||
if (wl_display_prepare_read(wayl->display) != 0) {
|
||||
LOG_ERRNO("failed to prepare for reading wayland events");
|
||||
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))
|
||||
{
|
||||
goto out;
|
||||
}
|
||||
|
||||
return wayl;
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue