From fe91c2f36af81ec9426e9821bd1e18df94869cbb Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Fri, 27 Jul 2018 23:02:08 +0200 Subject: [PATCH] MousePerspective: allow shutdown when no device If _device was not set yet then we will get an exception when accessing its 'profiles' attribute. GObject.Property does not support exceptions and we end up returning False. This caused Piper to think that there is a dirty profile and that warns the user about unapplied changes. --- piper/mouseperspective.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/piper/mouseperspective.py b/piper/mouseperspective.py index 51224ce..54e57a4 100644 --- a/piper/mouseperspective.py +++ b/piper/mouseperspective.py @@ -67,6 +67,9 @@ class MousePerspective(Gtk.Overlay): @GObject.Property def can_shutdown(self): + if self._device is None: + return True + """Whether this perspective can safely shutdown.""" for profile in self._device.profiles: if profile.dirty: