diff options
Diffstat (limited to 'src/platform/wayland/keyboard.c')
| -rw-r--r-- | src/platform/wayland/keyboard.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/platform/wayland/keyboard.c b/src/platform/wayland/keyboard.c index 9637341..cf6d56c 100644 --- a/src/platform/wayland/keyboard.c +++ b/src/platform/wayland/keyboard.c @@ -144,7 +144,7 @@ static void push_focus(struct wayland_surface *w, bool focused) static void keyboard_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { - (void)keyboard; (void)serial; (void)keys; + (void)keyboard; (void)keys; struct seat *s = data; struct wayland_surface *w = surface_root(surface ? (struct wayland_surface *)wl_surface_get_user_data(surface) : NULL); @@ -155,6 +155,8 @@ static void keyboard_enter(void *data, struct wl_keyboard *keyboard, s->keyboard_focus = NULL; return; } + /* The enter serial is a valid input serial, e.g. for set_selection. */ + seat_note_input(s, serial); bool focused = conn_keyboard_on(s->conn, w, s); s->keyboard_focus = w; keyboard_reset_keys(s, w); @@ -433,12 +435,12 @@ bool wayland_display_copy_text(struct wayland_display *c, enum yasl_private_sele errno = EINVAL; return false; } - if (!s || !s->clipboard) { - errno = ENOTSUP; + if (!s || !s->keyboard_focus || !s->input_serial) { + errno = ESTALE; return false; } - if (!s->input_serial) { - errno = EAGAIN; + if (!s->clipboard) { + errno = ENOTSUP; return false; } errno = 0; |
