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.
This commit is contained in:
Daniel Eklöf 2020-08-10 18:57:17 +02:00
parent 544c1b1976
commit 6b18bd998a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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);