Seat: avoid leaking eaten keys to client on focus

Until now, Seat.setFocusRaw sent all pressed keys to the client,
including ones that should be eaten. (Try e.g. changing focus to a
nested wlroots compositor with a terminal open to easily see it.)

However, only filtering out the eaten keys is not enough; they were
eaten only once all mappings had been executed. Therefore, the original
function had to be split into one looking up mappings and another
executing them.
This commit is contained in:
tiosgz
2022-05-29 19:59:41 +00:00
committed by Isaac Freund
parent 6d6646febe
commit 1e3b8ed161
3 changed files with 47 additions and 9 deletions

View File

@ -50,3 +50,8 @@ pub fn remove(self: *Self, old: u32) bool {
return false;
}
/// Removes other's contents from self (if present)
pub fn subtract(self: *Self, other: Self) void {
for (other.items[0..other.len]) |item| _ = self.remove(item);
}