diff options
| author | tiosgz <alamica@protonmail.com> | 2022-07-19 09:35:34 +0000 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2022-07-19 13:17:09 +0200 |
| commit | 7443e1377ad6b260f4c9bc14ff02082ced8abb6b (patch) | |
| tree | 7fbf6c41201abcd95d9fa773a2983f05ebc7ed65 | |
| parent | 55cf8ad6697ba4c2d9fd157db6abb70be8baba65 (diff) | |
| download | river-7443e1377ad6b260f4c9bc14ff02082ced8abb6b.tar.gz river-7443e1377ad6b260f4c9bc14ff02082ced8abb6b.tar.xz | |
LayoutDemand: handle too many view dimensions correctly
The condition was wrong for the first extra view (0 isn't < 0), plus
the counting stopped at that moment.
| -rw-r--r-- | river/LayoutDemand.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/river/LayoutDemand.zig b/river/LayoutDemand.zig index 11c3295..4ad65e7 100644 --- a/river/LayoutDemand.zig +++ b/river/LayoutDemand.zig @@ -83,7 +83,10 @@ fn handleTimeout(layout: *Layout) callconv(.C) c_int { /// Push a set of proposed view dimensions and position to the list pub fn pushViewDimensions(self: *Self, output: *Output, x: i32, y: i32, width: u32, height: u32) void { // The client pushed too many dimensions - if (self.views < 0) return; + if (self.views <= 0) { + self.views -= 1; + return; + } // Here we apply the offset to align the coords with the origin of the // usable area and shrink the dimensions to accomodate the border size. |
