Skip to content

Commit

Permalink
Improved response to power state changes in Switchboard (#191)
Browse files Browse the repository at this point in the history
This resolves a problem if the user turns off Bluetooth in Switchboard,
the Wingpanel indicator would immediately turn it back on (and vice
versa).
  • Loading branch information
stan-janssen authored Apr 2, 2023
1 parent 23d2560 commit ce88a7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Services/Manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public class BluetoothIndicator.Services.ObjectManager : Object {
((DBusProxy) adapter).g_properties_changed.connect ((changed, invalid) => {
var powered = changed.lookup_value ("Powered", new VariantType ("b"));
if (powered != null) {
set_last_state.begin ();
set_global_state.begin (powered.get_boolean ());
}
});
}
Expand Down Expand Up @@ -217,6 +217,7 @@ public class BluetoothIndicator.Services.ObjectManager : Object {
}

settings.set_boolean ("bluetooth-enabled", state);
check_global_state ();
}

public async void set_last_state () {
Expand Down

0 comments on commit ce88a7b

Please sign in to comment.