mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-17 19:56:41 -04:00
screenreader: Always try to start/stop orca in set_enabled
This commit is contained in:
parent
f62aa583e1
commit
84371fcc4e
1 changed files with 13 additions and 15 deletions
|
@ -146,21 +146,19 @@ impl<'dbus> OrcaManager<'dbus> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn set_enabled(&mut self, enable: bool) -> Result<()> {
|
pub async fn set_enabled(&mut self, enable: bool) -> Result<()> {
|
||||||
if self.enabled == enable {
|
if enable != self.enabled {
|
||||||
return Ok(());
|
#[cfg(not(test))]
|
||||||
}
|
{
|
||||||
|
let a11ysettings = Settings::new(A11Y_SETTING);
|
||||||
#[cfg(not(test))]
|
a11ysettings
|
||||||
{
|
.set_boolean(SCREEN_READER_SETTING, enable)
|
||||||
let a11ysettings = Settings::new(A11Y_SETTING);
|
.map_err(|e| anyhow!("Unable to set screen reader enabled gsetting, {e}"))?;
|
||||||
a11ysettings
|
}
|
||||||
.set_boolean(SCREEN_READER_SETTING, enable)
|
if let Err(e) = self.set_orca_enabled(enable).await {
|
||||||
.map_err(|e| anyhow!("Unable to set screen reader enabled gsetting, {e}"))?;
|
match e.downcast_ref::<std::io::Error>() {
|
||||||
}
|
Some(e) if e.kind() == ErrorKind::NotFound => (),
|
||||||
if let Err(e) = self.set_orca_enabled(enable).await {
|
_ => return Err(e),
|
||||||
match e.downcast_ref::<std::io::Error>() {
|
}
|
||||||
Some(e) if e.kind() == ErrorKind::NotFound => (),
|
|
||||||
_ => return Err(e),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if enable {
|
if enable {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue