Skip to content

Commit

Permalink
fix(ipc): regression - reload not working due to #592
Browse files Browse the repository at this point in the history
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,
  • Loading branch information
SerraPi authored May 19, 2024
1 parent 3b6480f commit 4ad4b0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ad4b0e

Please sign in to comment.