Ticket #96: 0001-CanvasPulsingIcon-Don-t-begin-pulse-loop-on-resume.patch

File 0001-CanvasPulsingIcon-Don-t-begin-pulse-loop-on-resume.patch, 1.5 KB (added by dsd, 15 years ago)

fix

  • src/jarabe/view/pulsingicon.py

    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): 
    205205
    206206        if self._paused:
    207207            self._pulser.stop()
    208         else:
     208        elif self._pulsing:
    209209            self._pulser.start(restart=False)
    210210
    211211    def get_paused(self):
    class CanvasPulsingIcon(CanvasIcon): 
    216216
    217217    def set_pulsing(self, pulsing):
    218218        self._pulsing = pulsing
     219        if self._paused:
     220            return
    219221
    220222        if self._pulsing:
    221223            self._pulser.start(restart=True)