diff --git a/monitors/src/backend/hyprland.rs b/monitors/src/backend/hyprland.rs index da5a6d1..48d88fd 100644 --- a/monitors/src/backend/hyprland.rs +++ b/monitors/src/backend/hyprland.rs @@ -17,7 +17,8 @@ use std::{ use super::wlr::{wlr_apply_monitor_configuration, wlr_get_monitor_information}; pub const HYPRFEATURES: MonitorFeatures = MonitorFeatures { - vrr: true, + // Hyprland supports vrr, but can't be changed on the fly -> reload required + vrr: false, // Hyprland has no primary monitor concept primary: false, fractional_scaling: true, @@ -121,12 +122,13 @@ pub fn hy_save_monitor_configuration(monitors: &Vec) { let mut monitor_string = String::new(); for monitor in monitors { - let vrr = if monitor.vrr { 1 } else { 0 }; + // re-enabled when switching is supported on the fly + // let vrr = if monitor.vrr { 1 } else { 0 }; if !monitor.enabled { monitor_string += &format!("keyword monitor {},disabled;", monitor.name); } else { monitor_string += &format!( - "monitor={},{}x{}@{},{}x{},{:.6},transform,{},vrr,{}\n", + "monitor={},{}x{}@{},{}x{},{:.6},transform,{}\n", monitor.name, monitor.size.0, monitor.size.1, @@ -135,7 +137,7 @@ pub fn hy_save_monitor_configuration(monitors: &Vec) { monitor.offset.1, monitor.scale, monitor.transform, - vrr + // vrr ); } } @@ -207,12 +209,13 @@ fn monitor_to_configstring(monitors: &Vec) -> String { let mut strings = Vec::new(); for monitor in monitors { - let vrr = if monitor.vrr { 1 } else { 0 }; + // re-enabled when switching is supported on the fly + // let vrr = if monitor.vrr { 1 } else { 0 }; if !monitor.enabled { strings.push(format!("keyword monitor {},disabled;", monitor.name)); } else { strings.push(format!( - "keyword monitor {},{}x{}@{},{}x{},{:.6},transform,{},vrr,{};", + "keyword monitor {},{}x{}@{},{}x{},{:.6},transform,{};", monitor.name, &monitor.size.0, &monitor.size.1, @@ -221,7 +224,7 @@ fn monitor_to_configstring(monitors: &Vec) -> String { &monitor.offset.1, &monitor.scale, &monitor.transform, - vrr + // vrr )); } } diff --git a/monitors/src/frontend/handlers.rs b/monitors/src/frontend/handlers.rs index e4e368c..24778a0 100644 --- a/monitors/src/frontend/handlers.rs +++ b/monitors/src/frontend/handlers.rs @@ -238,14 +238,14 @@ pub fn get_monitor_settings_group( ); let model_list = StringList::new(&[ - "0", - "90", - "180", - "270", - "0-flipped", - "90-flipped", - "180-flipped", - "270-flipped", + "0°", + "90°", + "180°", + "270°", + "0°-flipped", + "90°-flipped", + "180°-flipped", + "270°-flipped", ]); let transform = adw::ComboRow::new(); transform.set_tooltip_markup(Some("Changes the orientation of the monitor")); @@ -269,14 +269,14 @@ pub fn get_monitor_settings_group( let monitor = monitors.get_mut(monitor_index).unwrap(); let original_monitor = monitor.clone(); match model_list.string(dropdown.selected()).unwrap().as_str() { - "0" => monitor.transform = 0, - "90" => monitor.transform = 1, - "180" => monitor.transform = 2, - "270" => monitor.transform = 3, - "0-flipped" => monitor.transform = 4, - "90-flipped" => monitor.transform = 5, - "180-flipped" => monitor.transform = 6, - "270-flipped" => monitor.transform = 7, + "0°" => monitor.transform = 0, + "90°" => monitor.transform = 1, + "180°" => monitor.transform = 2, + "270°" => monitor.transform = 3, + "0°-flipped" => monitor.transform = 4, + "90°-flipped" => monitor.transform = 5, + "180°-flipped" => monitor.transform = 6, + "270°-flipped" => monitor.transform = 7, _ => ERROR!("Received unexpected transform", ErrorLevel::Recoverable), }; rearrange_monitors(original_monitor, monitors); @@ -338,7 +338,7 @@ pub fn get_monitor_settings_group( rearrange_monitors(original_monitor, monitors); } - let refresh_rates: Vec = refresh_rates.iter().map(|x| x.0.to_string()).collect(); + let refresh_rates: Vec = refresh_rates.iter().map(|x| x.0.to_string() + "Hz").collect(); let refresh_rates: Vec<&str> = refresh_rates.iter().map(|x| x.as_str()).collect(); let refresh_rate_model = StringList::new(&refresh_rates); refresh_rate_combo_ref.set_model(Some(&refresh_rate_model)); @@ -390,7 +390,7 @@ pub fn get_monitor_settings_group( } } - let refresh_rates: Vec = refresh_rates.iter().map(|x| x.0.to_string()).collect(); + let refresh_rates: Vec = refresh_rates.iter().map(|x| x.0.to_string() + "Hz").collect(); let refresh_rates: Vec<&str> = refresh_rates.iter().map(|x| x.as_str()).collect(); let refresh_rate_model = StringList::new(&refresh_rates); refresh_rate.set_model(Some(&refresh_rate_model)); @@ -407,6 +407,7 @@ pub fn get_monitor_settings_group( .unwrap() .string() .to_string() + .trim_end_matches("Hz") .parse() .unwrap(); if monitor.uses_mode_id {