From 4ad4b0e070cc4e271251763db7210e70857d68ca Mon Sep 17 00:00:00 2001 From: SerraPi <95191556+SerraPi@users.noreply.github.com> Date: Sun, 19 May 2024 15:35:52 -0600 Subject: [PATCH] fix(ipc): regression - reload not working due to #592 let index = match index { Some(index) => index - 1, None => { lock!(map).push(monitor_name.clone()); lock!(map).len() - 1 } }; //This causes index to underflow //Expected Output is something like 0, 1, etc //But sometimes we go back around to 18446744073709551615 //Removing the -1 here seems to work ok with multi monitor, and reload is not broken anymore Some(index) => index, --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f00bcbc..441c0e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -353,7 +353,7 @@ fn load_output_bars( let index = lock!(map).iter().position(|n| n == monitor_name); let index = match index { - Some(index) => index - 1, + Some(index) => index, None => { lock!(map).push(monitor_name.clone()); lock!(map).len() - 1