From e5aae89fc7897e32917fb02160e20bf550f69bfc Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Sat, 18 Mar 2023 21:23:18 +0300 Subject: [PATCH] mouseperspective: enable the "commit" button if any profile is dirty ..not only the active one. This fixes the "commit" button not getting active when another profile is disabled outside of Piper (e.g. ratbagctl). --- piper/mouseperspective.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/piper/mouseperspective.py b/piper/mouseperspective.py index 7ba27cb..e9505cc 100644 --- a/piper/mouseperspective.py +++ b/piper/mouseperspective.py @@ -198,11 +198,10 @@ class MousePerspective(Gtk.Overlay): def _on_profile_notify_dirty( self, profile: RatbagdProfile, pspec: Optional[GObject.ParamSpec] ) -> None: - if profile is not self._profile: - return + device_dirty = any(p.dirty for p in self._device.profiles) style_context = self.button_commit.get_style_context() - if profile.dirty: + if device_dirty: style_context.add_class("suggested-action") self.button_commit.set_sensitive(True) else: