Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2008-12-07 14:31:07 (GMT)
committer Daniel Drake <dsd@laptop.org>2008-12-07 14:31:07 (GMT)
commit50548c9f4d9d4d7f9fdd63cb66a9387dd8da414e (patch)
tree046c72b9ce3ee023636205d9ca8469f7de408544
parent958504b1ca5760ec263e72f69787e9cd5afc7118 (diff)
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.
-rw-r--r--src/jarabe/view/pulsingicon.py4
1 files changed, 3 insertions, 1 deletions
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)