From 50548c9f4d9d4d7f9fdd63cb66a9387dd8da414e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Sun, 07 Dec 2008 14:31:07 +0000 Subject: CanvasPulsingIcon: Don't begin pulse loop on resume if not pulsing When switching to the Neighborhood view, the system starts waking up 10 times per second *per AP*, even though nothing on the screen is being updated. This is because meshbox attemps to unpause all its AP pulsing icons, and CanvasPulsingIcon makes the incorrect assumption that an icon being resumed was previously pulsing. Add a check that only resumes the pulse loop if the icon was already pulsing, and also (for safety and clarity) prevent the pulse loop from starting on a paused icon. --- (limited to 'src') diff --git a/src/jarabe/view/pulsingicon.py b/src/jarabe/view/pulsingicon.py index e04b117..3627f3b 100644 --- a/src/jarabe/view/pulsingicon.py +++ b/src/jarabe/view/pulsingicon.py @@ -205,7 +205,7 @@ class CanvasPulsingIcon(CanvasIcon): if self._paused: self._pulser.stop() - else: + elif self._pulsing: self._pulser.start(restart=False) def get_paused(self): @@ -216,6 +216,8 @@ class CanvasPulsingIcon(CanvasIcon): def set_pulsing(self, pulsing): self._pulsing = pulsing + if self._paused: + return if self._pulsing: self._pulser.start(restart=True) -- cgit v0.9.1