tony / oxwm

fixed panic on monitor plug/unplug: reversed for ranges in updateGeom underflowed on count change Browse files
tonybanters committed 2026-08-24 parent afc403f commit 5342e9da382fc0ecaa8c7a29b1aa7d6296255f54
Showing 1 changed file with 2 additions and 2 deletions. UnifiedSplit
+2 −2 src/wm/wm.zig
@@ -261,7 +261,7 @@ pub const WindowManager = struct {
261 261
262 262 const new_count: usize = @intCast(nn);
263 263
264 - for (n..new_count) |_| {
264 + for (0..new_count -| n) |_| {
265 265 var last = self.monitors;
266 266 while (last) |mon| {
267 267 if (mon.next == null) break;
@@ -313,7 +313,7 @@ pub const WindowManager = struct {
313 313 m = mon.next;
314 314 }
315 315
316 - for (new_count..n) |_| {
316 + for (0..n -| new_count) |_| {
317 317 var last: ?*Monitor = null;
318 318 var iter = self.monitors;
319 319 while (iter) |mon| {