Skip to content

Commit

Permalink
monitors: use offset in refresh-rates for all id users
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Jun 13, 2024
1 parent 4e47361 commit 79d9bf3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions monitors/src/frontend/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ pub fn get_monitor_settings_group(
let selected = selected.string().to_string();
let (x, y) = selected.split_once('x').unwrap();
let refresh_rates;
let uses_ids;
{
let mut monitors = resolution_ref.borrow_mut();
let monitor = monitors.get_mut(monitor_index).unwrap();
Expand All @@ -335,13 +336,14 @@ pub fn get_monitor_settings_group(
let (width, height) = monitor.handle_scaled_transform();
monitor.drag_information.width = width;
monitor.drag_information.height = height;
uses_ids = monitor.uses_mode_id;
rearrange_monitors(original_monitor, monitors);
}

let mut converted_rates = Vec::new();
for rate in refresh_rates.into_iter() {
let string_rate = rate.0.to_string() + "Hz";
if is_gnome() {
if uses_ids {
if !converted_rates.contains(&string_rate) {
converted_rates.push(string_rate);
}
Expand Down Expand Up @@ -399,8 +401,8 @@ pub fn get_monitor_settings_group(
let mut iter = 0;
for refresh_rate in refresh_rates.into_iter() {
let rate = refresh_rate.0.to_string() + "Hz";
if is_gnome() && converted_rates.contains(&rate) {
// gnome requires ids
if monitor.uses_mode_id && converted_rates.contains(&rate) {
// id users might see duplicate entries otherwise
continue;
}
converted_rates.push(rate);
Expand Down

0 comments on commit 79d9bf3

Please sign in to comment.