Skip to content

Commit

Permalink
Clearer duplicate warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Dec 5, 2023
1 parent b58b356 commit 71ce596
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions virtual-display-driver/src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,20 @@ fn has_duplicates(monitors: &[Monitor]) -> bool {
.iter()
.any(|m| mode.height == m.height && mode.width == m.width);
if duplicate_mode {
warn!("Found duplicate mode {}x{}", mode.width, mode.height);
warn!(
"Found duplicate mode {}x{} on monitor {}",
mode.width, mode.height, monitor.id
);
return true;
}

for (k, rr) in mode.refresh_rates.iter().copied().enumerate() {
let duplicate_rr = mode.refresh_rates[k + 1..].iter().any(|&r| rr == r);
if duplicate_rr {
warn!("Found duplicate refresh rate {rr}");
warn!(
"Found duplicate refresh rate {rr} on mode {}x{} for monitor {}",
mode.width, mode.height, monitor.id
);
return true;
}
}
Expand Down

0 comments on commit 71ce596

Please sign in to comment.