Update Monado IPC, display brightness slider

This commit is contained in:
Aleksander
2026-01-08 20:54:43 +01:00
parent e421c39539
commit b260c6c625
12 changed files with 225 additions and 154 deletions

View File

@@ -31,6 +31,8 @@ pub trait DashInterface<T> {
fn process_terminate(&mut self, data: &mut T, handle: WvrProcessHandle) -> anyhow::Result<()>;
fn monado_client_list(&mut self, data: &mut T) -> anyhow::Result<Vec<MonadoClient>>;
fn monado_client_focus(&mut self, data: &mut T, name: &str) -> anyhow::Result<()>;
fn monado_brightness_get(&mut self, data: &mut T) -> Option<f32>;
fn monado_brightness_set(&mut self, data: &mut T, brightness: f32) -> Option<()>;
fn recenter_playspace(&mut self, data: &mut T) -> anyhow::Result<()>;
fn desktop_finder<'a>(&'a mut self, data: &'a mut T) -> &'a mut DesktopFinder;
fn general_config<'a>(&'a mut self, data: &'a mut T) -> &'a mut GeneralConfig;

View File

@@ -62,6 +62,7 @@ pub struct DashInterfaceEmulated {
desktop_finder: DesktopFinder,
general_config: GeneralConfig,
monado_clients: Vec<dash_interface::MonadoClient>,
brightness: f32,
}
impl DashInterfaceEmulated {
@@ -119,6 +120,7 @@ impl DashInterfaceEmulated {
desktop_finder,
general_config,
monado_clients,
brightness: 1.0,
}
}
}
@@ -243,4 +245,13 @@ impl DashInterface<()> for DashInterfaceEmulated {
}
Ok(())
}
fn monado_brightness_get(&mut self, _: &mut ()) -> Option<f32> {
Some(self.brightness)
}
fn monado_brightness_set(&mut self, _: &mut (), brightness: f32) -> Option<()> {
self.brightness = brightness;
Some(())
}
}