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.
This commit is contained in:
Thomas Hindoe Paaboel Andersen
2018-07-27 23:02:08 +02:00
committed by Peter Hutterer
parent 161ca99049
commit fe91c2f36a

View File

@@ -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: