ratbagd.py: make the profile dirty after changing report rate
This fixes the "Apply" button being disabled after changing report rate
in Piper (once this file gets synchronized there).
@@ -391,6 +391,7 @@ class RatbagdProfile(_RatbagdDBus):
super().__init__("Profile", object_path)
self._dirty = False
self._active = self._get_dbus_property("IsActive")
+ self._report_rate = self._get_dbus_property("ReportRate")
# FIXME: if we start adding and removing objects from any of these
# lists, things will break!
@@ -423,6 +424,12 @@ class RatbagdProfile(_RatbagdDBus):
self.notify("is-active")
self._on_obj_notify(None, None)
+ if "ReportRate" in changed_props.keys():
+ report_rate = changed_props["ReportRate"]
+ if report_rate != self._report_rate:
+ self._report_rate = report_rate
+ self._on_obj_notify(None, None)
+
@GObject.Property
def capabilities(self):
"""The capabilities of this profile as an array. Capabilities not
@@ -468,9 +475,9 @@ class RatbagdProfile(_RatbagdDBus):
self._set_dbus_property("Enabled", "b", enabled)
@GObject.Property
- def report_rate(self):
+ def report_rate(self) -> int:
"""The report rate in Hz."""
- return self._get_dbus_property("ReportRate")
+ return self._report_rate
@report_rate.setter
def report_rate(self, rate):
