mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -04:00
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:
parent
544c1b1976
commit
6b18bd998a
1 changed files with 9 additions and 5 deletions
14
wayland.c
14
wayland.c
|
|
@ -912,18 +912,22 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
|
||||||
|
|
||||||
if (seat->kbd_focus != NULL) {
|
if (seat->kbd_focus != NULL) {
|
||||||
LOG_WARN("compositor destroyed seat '%s' "
|
LOG_WARN("compositor destroyed seat '%s' "
|
||||||
"without sending keyboard/pointer leave events",
|
"without sending a keyboard leave event",
|
||||||
seat->name);
|
seat->name);
|
||||||
|
|
||||||
struct terminal *term = seat->kbd_focus;
|
|
||||||
|
|
||||||
if (seat->wl_keyboard != NULL)
|
if (seat->wl_keyboard != NULL)
|
||||||
keyboard_listener.leave(
|
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)
|
if (seat->wl_pointer != NULL)
|
||||||
pointer_listener.leave(
|
pointer_listener.leave(
|
||||||
seat, seat->wl_pointer, -1, term->window->surface);
|
seat, seat->wl_pointer, -1, seat->mouse_focus->window->surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
seat_destroy(seat);
|
seat_destroy(seat);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue