From 50548c9f4d9d4d7f9fdd63cb66a9387dd8da414e Mon Sep 17 00:00:00 2001
From: Daniel Drake <dsd@laptop.org>
Date: Sun, 7 Dec 2008 14:31:07 +0000
Subject: [PATCH] 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.
---
src/jarabe/view/pulsingicon.py | 4 +++-
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
|
b
|
class CanvasPulsingIcon(CanvasIcon): |
205 | 205 | |
206 | 206 | if self._paused: |
207 | 207 | self._pulser.stop() |
208 | | else: |
| 208 | elif self._pulsing: |
209 | 209 | self._pulser.start(restart=False) |
210 | 210 | |
211 | 211 | def get_paused(self): |
… |
… |
class CanvasPulsingIcon(CanvasIcon): |
216 | 216 | |
217 | 217 | def set_pulsing(self, pulsing): |
218 | 218 | self._pulsing = pulsing |
| 219 | if self._paused: |
| 220 | return |
219 | 221 | |
220 | 222 | if self._pulsing: |
221 | 223 | self._pulser.start(restart=True) |