mirror of
https://github.com/libratbag/piper.git
synced 2026-05-19 04:16:08 -04:00
ratbagd: send out a GObject signal when the daemon disappears
So we can handle this gracefully in Piper. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Jente Hidskes
parent
06973d1234
commit
1d40b14722
@@ -278,12 +278,18 @@ class Ratbagd(_RatbagdDBus):
|
||||
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
|
||||
"device-removed":
|
||||
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
|
||||
"daemon-disappeared":
|
||||
(GObject.SignalFlags.RUN_FIRST, None, ()),
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
_RatbagdDBus.__init__(self, "Manager", None)
|
||||
result = self._get_dbus_property("Devices") or []
|
||||
self._devices = [RatbagdDevice(objpath) for objpath in result]
|
||||
self._proxy.connect("notify::g-name-owner", self._on_name_owner_changed)
|
||||
|
||||
def _on_name_owner_changed(self, *kwargs):
|
||||
self.emit("daemon-disappeared")
|
||||
|
||||
def _on_properties_changed(self, proxy, changed_props, invalidated_props):
|
||||
if "Devices" in changed_props.keys():
|
||||
|
||||
Reference in New Issue
Block a user