Ticket #1310: sugar-1310.patch

File sugar-1310.patch, 2.4 KB (added by alsroot, 12 years ago)
  • src/sugar/graphics/palette.py

    From ff56fb9271b2cb35122909182c5c4056184b1320 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Wed, 9 Sep 2009 12:41:37 +0000
    Subject: Stop all animators on poup/popdown invoking #1310
    
    ---
     src/sugar/graphics/palette.py       |   16 +++++++++++-----
     src/sugar/graphics/palettewindow.py |    8 +++-----
     2 files changed, 14 insertions(+), 10 deletions(-)
    
    diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
    index 2ea2376..f4b18c0 100644
    a b class Palette(PaletteWindow): 
    193193            state = self.PRIMARY
    194194        self.set_palette_state(state)
    195195
    196         self._secondary_anim.start()
     196        if state == self.PRIMARY:
     197            self._secondary_anim.start()
     198        else:
     199            self._secondary_anim.stop()
    197200
    198     def on_popdown(self):
    199         # to suppress glitches while later re-opening
    200         self.set_palette_state(self.PRIMARY)
     201    def popdown(self, immediate=False):
     202        if immediate:
     203            # to suppress glitches while later re-opening
     204            self.set_palette_state(self.PRIMARY)
     205        PaletteWindow.popdown(self, immediate)
     206        self._secondary_anim.stop()
    201207
    202208    def on_enter(self, event):
    203209        PaletteWindow.on_enter(self, event)
  • src/sugar/graphics/palettewindow.py

    diff --git a/src/sugar/graphics/palettewindow.py b/src/sugar/graphics/palettewindow.py
    index 73c6ae7..d08052f 100644
    a b class PaletteWindow(gtk.Window): 
    319319        if not immediate:
    320320            self._popup_anim.start()
    321321        else:
     322            self._popup_anim.stop()
    322323            self.show()
    323324            # we have to invoke update_position() twice
    324325            # since WM could ignore first move() request
    class PaletteWindow(gtk.Window): 
    326327
    327328    def popdown(self, immediate=False):
    328329        logging.debug('PaletteWindow.popdown immediate %r', immediate)
    329         self._popup_anim.stop()
    330330
     331        self._popup_anim.stop()
    331332        self._mouse_detector.stop()
    332333
    333334        if not immediate:
    334335            self._popdown_anim.start()
    335336        else:
    336             self.on_popdown()
     337            self._popdown_anim.stop()
    337338            self.size_request()
    338339            self.hide()
    339340
    340     def on_popdown(self):
    341         self._popdown_anim.stop()
    342 
    343341    def on_invoker_enter(self):
    344342        self._mouse_detector.start()
    345343