From 1aa935e6d81603505701bb8bb97e1e4fee589721 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 30 Aug 2022 20:26:28 +0300 Subject: [PATCH] libweston/input: Assert if we're still having a notify listener installed Tracking correctly previous events shouldn't corrupt the surface destroy signal list. This enforces that by ensuring that we wouldn't have a .notify wl_listener still being set (which shouldn't happen if we do eventually get a focus_in event that clears it out). Suggested-by: Alexandros Frantzis Signed-off-by: Marius Vlad --- libweston/input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libweston/input.c b/libweston/input.c index ead4b79e..6cbb8db0 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -2329,6 +2329,7 @@ notify_keyboard_focus_out(struct weston_seat *seat) if (focus) { seat->use_saved_kbd_focus = true; seat->saved_kbd_focus = focus; + assert(seat->saved_kbd_focus_listener.notify == NULL); seat->saved_kbd_focus_listener.notify = destroy_device_saved_kbd_focus; wl_signal_add(&focus->destroy_signal,