Skip to content

Commit

Permalink
monitors: don't collapse refreshrates for non gnome environments
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Jun 13, 2024
1 parent 3b12cd9 commit 3ba5257
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions monitors/src/frontend/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,20 +396,18 @@ pub fn get_monitor_settings_group(
let mut converted_rates: Vec<String> = Vec::new();

let mut index = 0;
for (i, refresh_rate) in refresh_rates.iter().enumerate() {
let mut iter = 0;
for refresh_rate in refresh_rates.into_iter() {
let rate = monitor.refresh_rate.to_string() + "Hz";
if is_gnome() && converted_rates.contains(&rate) {
// gnome requires ids
continue;
}
converted_rates.push(rate);
if refresh_rate.0 == monitor.refresh_rate {
let rate = monitor.refresh_rate.to_string() + "Hz";
if is_gnome() {
// gnome requires ids
if !converted_rates.contains(&rate) {
converted_rates.push(rate);
index = i;
}
} else {
converted_rates.push(rate);
index = i;
}
index = iter;
}
iter += 1;
}

let refresh_rates: Vec<&str> = converted_rates.iter().map(|x| x.as_str()).collect();
Expand Down

0 comments on commit 3ba5257

Please sign in to comment.