rules: fix assertion failure

If a view that is currently being destroyed is matched by a newly added
rule river crashes due to an assertion failure.

Fix this and add another assertion to make this precondition more
visible to the users of RuleList.match().
This commit is contained in:
Isaac Freund
2024-02-21 13:34:24 +01:00
parent 53c09be846
commit 9b2d99fa79
2 changed files with 4 additions and 0 deletions

View File

@ -183,6 +183,8 @@ pub fn ruleDel(_: *Seat, args: []const [:0]const u8, _: *?[]const u8) Error!void
fn apply_ssd_rules() void {
var it = server.root.views.iterator(.forward);
while (it.next()) |view| {
if (view.destroying) continue;
if (server.config.rules.ssd.match(view)) |ssd| {
view.pending.ssd = ssd;
}