aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiosgz <alamica@protonmail.com>2023-08-06 13:59:28 +0000
committertiosgz <alamica@protonmail.com>2023-08-13 11:22:28 +0000
commit0cc930b738064cdab99fe4a34e07e0ae7d726b42 (patch)
tree0fbe43e442312f92ddb0f56e29ca85a450603b7a
parent4726a6b0f13abb0604615c548c1c333c529860d5 (diff)
downloadriver-0cc930b738064cdab99fe4a34e07e0ae7d726b42.tar.gz
river-0cc930b738064cdab99fe4a34e07e0ae7d726b42.tar.xz
Root: fix inflight_layout_demands counting
Not decreasing the counter caused a weird bug where disabling/removing an output (curiously, it seems to apply only to last active output being removed) would lock the user out of the session, not letting the transaction to complete (therefore hiding all views on a newly added output) and messing up focus. Fixes https://github.com/riverwm/river/issues/830
-rw-r--r--river/Root.zig13
1 files changed, 7 insertions, 6 deletions
diff --git a/river/Root.zig b/river/Root.zig
index c41ef34..1b4b2e3 100644
--- a/river/Root.zig
+++ b/river/Root.zig
@@ -274,12 +274,6 @@ pub fn deactivateOutput(root: *Self, output: *Output) void {
output.active_link.init();
}
- if (output.inflight.layout_demand) |layout_demand| {
- layout_demand.deinit();
- output.inflight.layout_demand = null;
- }
- while (output.layouts.first) |node| node.data.destroy();
-
{
var it = output.inflight.focus_stack.iterator(.forward);
while (it.next()) |view| {
@@ -335,6 +329,13 @@ pub fn deactivateOutput(root: *Self, output: *Output) void {
output.status.deinit();
output.status.init();
+
+ if (output.inflight.layout_demand) |layout_demand| {
+ layout_demand.deinit();
+ output.inflight.layout_demand = null;
+ root.notifyLayoutDemandDone();
+ }
+ while (output.layouts.first) |node| node.data.destroy();
}
/// Add the output to root.active_outputs and the output layout if it has not