From 6b18bd998a08eee404fbdb73a1a71627377b874b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Aug 2020 18:57:17 +0200 Subject: [PATCH] wayland: global-remove: fix call to pointer_listener.leave() Don't call it when we have keyboard focus, call it when we have mouse focus. --- wayland.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wayland.c b/wayland.c index 30271dd2..ec6c7896 100644 --- a/wayland.c +++ b/wayland.c @@ -912,18 +912,22 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) if (seat->kbd_focus != NULL) { LOG_WARN("compositor destroyed seat '%s' " - "without sending keyboard/pointer leave events", + "without sending a keyboard leave event", seat->name); - struct terminal *term = seat->kbd_focus; - if (seat->wl_keyboard != NULL) keyboard_listener.leave( - seat, seat->wl_keyboard, -1, term->window->surface); + seat, seat->wl_keyboard, -1, seat->kbd_focus->window->surface); + } + + if (seat->mouse_focus != NULL) { + LOG_WARN("compositor destroyed seat '%s' " + "without sending a pointer leave event", + seat->name); if (seat->wl_pointer != NULL) pointer_listener.leave( - seat, seat->wl_pointer, -1, term->window->surface); + seat, seat->wl_pointer, -1, seat->mouse_focus->window->surface); } seat_destroy(seat);