Skip to content

Commit

Permalink
Don't read orca prompt if already enabled (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Jul 21, 2023
1 parent 37fdf66 commit ea5faba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,15 @@ public class Installer.MainWindow : Hdy.Window {
});

var mediakeys_settings = new Settings ("org.gnome.settings-daemon.plugins.media-keys");
var a11y_settings = new Settings ("org.gnome.desktop.a11y.applications");

orca_timeout_id = Timeout.add_seconds (10, () => {
orca_timeout_id = 0;

if (a11y_settings.get_boolean ("screen-reader-enabled")) {
return Source.REMOVE;
}

var shortcut_string = Granite.accel_to_string (
mediakeys_settings.get_strv ("screenreader")[0]
);
Expand All @@ -126,7 +133,6 @@ public class Installer.MainWindow : Hdy.Window {
critical ("Couldn't read Orca prompt: %s", e.message);
}

orca_timeout_id = 0;
return Source.REMOVE;
});
}
Expand Down

0 comments on commit ea5faba

Please sign in to comment.