aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-10 16:57:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-13 16:47:19 +0000
commit6b18bd998a08eee404fbdb73a1a71627377b874b (patch)
tree6581a8f14433bf4c9a8c8da0385441bf8c0786f7
parentconfig: wip: add support for modifiers in mouse bindings (diff)
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.
-rw-r--r--wayland.c14
1 files 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);