aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-07-24 14:14:36 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-07-24 14:14:36 +0200
commit9c633a78886eec86337438b2e3d4189197257464 (patch)
tree93b4ec97be63d4781b2d29bc2aad2873b0093649
parent6f91011895de3db2cac0328a014c610d35411bce (diff)
downloadriver-9c633a78886eec86337438b2e3d4189197257464.tar.gz
river-9c633a78886eec86337438b2e3d4189197257464.tar.xz
layout: cleanup in progress layout demand on destroy
This fixes an issue where a layout client that crashed during a layout demand caused river to enter invalid state and potentially soft-lock.
-rw-r--r--river/Layout.zig13
1 files changed, 7 insertions, 6 deletions
diff --git a/river/Layout.zig b/river/Layout.zig
index 9fe6109..a8fe83b 100644
--- a/river/Layout.zig
+++ b/river/Layout.zig
@@ -173,13 +173,14 @@ pub fn destroy(self: *Self) void {
const node = @fieldParentPtr(std.TailQueue(Self).Node, "data", self);
self.output.layouts.remove(node);
- // If we are the currently active layout of an output, clean up. The output
- // will always end up with no layout at this point, so we directly start the
- // transaction.
- if (self == self.output.pending.layout) {
+ // If we are the currently active layout of an output, clean up.
+ if (self.output.pending.layout == self) {
self.output.pending.layout = null;
- self.output.arrangeViews();
- server.root.startTransaction();
+ if (self.output.layout_demand) |*layout_demand| {
+ layout_demand.deinit();
+ self.output.layout_demand = null;
+ server.root.notifyLayoutDemandDone();
+ }
}
self.layout.setHandler(?*c_void, handleRequestInert, null, null);