From 0536ff627f1ec731b090bc4205e1128afa5b98fc Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Tue, 13 Feb 2024 02:04:39 +0100 Subject: [PATCH] Fix device removal (#265) --- src/DeviceRow.vala | 1 - src/InputPanel.vala | 2 ++ src/OutputPanel.vala | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DeviceRow.vala b/src/DeviceRow.vala index 9ff7fecb..78ecaa12 100644 --- a/src/DeviceRow.vala +++ b/src/DeviceRow.vala @@ -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; diff --git a/src/InputPanel.vala b/src/InputPanel.vala index 28a473c3..3fb0be1e 100644 --- a/src/InputPanel.vala +++ b/src/InputPanel.vala @@ -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)); } } diff --git a/src/OutputPanel.vala b/src/OutputPanel.vala index 0ebcbeb4..b8e8eb32 100644 --- a/src/OutputPanel.vala +++ b/src/OutputPanel.vala @@ -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 () {