diff options
author | Daniel Drake <dsd@laptop.org> | 2008-12-07 14:31:07 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2008-12-07 14:31:07 (GMT) |
commit | 50548c9f4d9d4d7f9fdd63cb66a9387dd8da414e (patch) | |
tree | 046c72b9ce3ee023636205d9ca8469f7de408544 /src | |
parent | 958504b1ca5760ec263e72f69787e9cd5afc7118 (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.
Diffstat (limited to 'src')
-rw-r--r-- | 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/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) |