Fix crash when killing WM with windows active

In commit 75308a04, I added an assertion to Output.destroy() to verify
that all of its windows had been removed already. The issue is, that
only happened when Output received a .removed event, but that never
came when killing the WM directly. Instead, I simplified the handling
for the .removed event and moved most of that into destroy().

I also changed where structs have their wl_list.link removed (to inside
of their destroys) to make it more consistent. Finally,
XkbBinding.sendWindowToOutput asserts that the current output is actually
focused. Users *should* never have a focused window if there's not also
a focused output.
This commit is contained in:
Ben Buhse 2026-04-12 10:31:45 -05:00
commit e862aca887
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
7 changed files with 56 additions and 72 deletions

View file

@ -42,8 +42,8 @@ const Keyboard = struct {
}
fn destroy(keyboard: *Keyboard) void {
keyboard.link.remove();
keyboard.xkb_keyboard_v1.destroy();
keyboard.link.remove();
utils.gpa.destroy(keyboard);
}