diff options
Diffstat (limited to 'src/platform/wayland/keyboard.c')
| -rw-r--r-- | src/platform/wayland/keyboard.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/platform/wayland/keyboard.c b/src/platform/wayland/keyboard.c index cf6d56c..294f553 100644 --- a/src/platform/wayland/keyboard.c +++ b/src/platform/wayland/keyboard.c @@ -336,23 +336,22 @@ static void keyboard_key(void *data, struct wl_keyboard *keyboard, } } -static int keyboard_repeat_ready(int fd, short revents, void *data) +static void keyboard_repeat_ready(void *data, int fd, short revents) { struct seat *s = data; uint64_t count; - if (!(revents & POLLIN) || read(fd, &count, sizeof(count)) != sizeof(count)) return 0; + if (!(revents & POLLIN) || read(fd, &count, sizeof(count)) != sizeof(count)) return; struct wayland_surface *w = s->keyboard_focus; if (!w) { keyboard_repeat_stop(s); - return 0; + return; } if (count > 32) count = 32; while (count-- && s->repeat_held && s->repeat_rate > 0) { if (!keyboard_dispatch_key(s, w, s->repeat_key, YASL_KEY_REPEAT)) keyboard_repeat_stop(s); } - return 0; } static void keyboard_modifiers(void *data, struct wl_keyboard *keyboard, @@ -391,7 +390,7 @@ int keyboard_repeat_init(struct seat *s) if (s->repeat_fd >= 0) return 0; s->repeat_fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC); if (s->repeat_fd < 0) return -1; - s->repeat_watch = yasl_private_loop_add_fd(s->conn->loop, s->repeat_fd, POLLIN, + s->repeat_watch = yasl_loop_add_fd(s->conn->loop, s->repeat_fd, POLLIN, keyboard_repeat_ready, s); if (s->repeat_watch <= 0) { s->repeat_watch = 0; |
