Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
Window: clear focus in makeInert() rather than unmap()
It was reported that the focus assertion in destroy() was hit.
I think this should fix it.
river/Window.zig | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/river/Window.zig b/river/Window.zig
index fb91514..7b4ad00 100644
--- a/river/Window.zig
+++ b/river/Window.zig
@@ -573,6 +573,14 @@ fn handleDestroy(_: *river.WindowV1, window: *Window) void {
var it = decorations.iterator(.forward);
while (it.next()) |decoration| decoration.makeInert();
}
+ {
+ var it = server.input_manager.seats.iterator(.forward);
+ while (it.next()) |seat| {
+ if (seat.focused == .window and seat.focused.window == window) {
+ seat.focus(.none);
+ }
+ }
+ }
}
fn handleRequest(
@@ -1180,15 +1188,6 @@ pub fn unmap(window: *Window) void {
handle.destroy();
window.wlr_toplevel_handle = null;
}
-
- {
- var it = server.input_manager.seats.iterator(.forward);
- while (it.next()) |seat| {
- if (seat.focused == .window and seat.focused.window == window) {
- seat.focus(.none);
- }
- }
- }
}
pub fn notifyTitle(window: *Window) void {