Skip to content

Commit

Permalink
Bind properties in correct order (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypw authored Aug 19, 2024
1 parent 98cdd11 commit 8616cca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/OutputPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ public class Sound.OutputPanel : Gtk.Box {
append (test_button);

var applications_settings = new GLib.Settings ("org.gnome.desktop.a11y.applications");
applications_settings.bind ("screen-reader-enabled", this, "screen_reader_active", SettingsBindFlags.DEFAULT);
bind_property ("screen_reader_active", screen_reader_switch, "active", GLib.BindingFlags.BIDIRECTIONAL, () => {

bind_property ("screen-reader-active", screen_reader_switch, "active", GLib.BindingFlags.BIDIRECTIONAL, () => {
if (screen_reader_active != screen_reader_switch.active) {
screen_reader_switch.activate ();
}
}, null);

applications_settings.bind ("screen-reader-enabled", this, "screen_reader_active", SettingsBindFlags.DEFAULT);

pam = PulseAudioManager.get_default ();
pam.new_device.connect (add_device);
pam.notify["default-output"].connect (default_changed);
Expand Down

0 comments on commit 8616cca

Please sign in to comment.