Skip to content

Commit

Permalink
Fix device removal (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 authored Feb 13, 2024
1 parent 6d8a2c9 commit 0536ff6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/DeviceRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public class Sound.DeviceRow : Gtk.ListBoxRow {
device.bind_property ("display-name", name_label, "label");
device.bind_property ("description", description_label, "label");

device.removed.connect (() => destroy ());
device.notify["is-default"].connect (() => {
ignore_default = true;
activate_radio.active = device.is_default;
Expand Down
2 changes: 2 additions & 0 deletions src/InputPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,7 @@ public class Sound.InputPanel : Gtk.Box {
device_row.set_as_default.connect (() => {
pam.set_default_device.begin (device);
});

device.removed.connect (() => devices_listbox.remove (device_row));
}
}
2 changes: 2 additions & 0 deletions src/OutputPanel.vala
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ public class Sound.OutputPanel : Gtk.Box {
device_row.set_as_default.connect (() => {
pam.set_default_device.begin (device);
});

device.removed.connect (() => devices_listbox.remove (device_row));
}

private void notify_change () {
Expand Down

0 comments on commit 0536ff6

Please sign in to comment.