git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitc8c4b6f9314b4b506045e64d9a6f3eee9677699d
parent494fcd0ec5
authorIsaac Freund <[email protected]>
date2025-11-29 15:40
Output: destroy layer surfaces on destroy

 river/Output.zig | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/river/Output.zig b/river/Output.zig
index be05c07..61bab2f 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -207,6 +207,15 @@ fn handleDestroy(listener: *wl.Listener(*wlr.Output), wlr_output: *wlr.Output) v
 
     log.debug("output '{s}' destroyed", .{wlr_output.name});
 
+    {
+        var it = server.layer_shell.surfaces.iterator();
+        while (it.next()) |surface| {
+            if (surface.wlr_layer_surface.output == wlr_output) {
+                surface.wlr_layer_surface.destroy();
+            }
+        }
+    }
+
     output.link.remove();
 
     output.destroy.link.remove();