That bundle contains adaptation of the PigmentFrontend to make use of
the new ways of updating animations in Pigment.
It connects to the new 'update-pass' signal to trigger the tick and set
the global pgm.timing.ticker.Ticker for all the
pgm.timing.controller.Controllers.

It also adds a comment about automatic regeneration of drawables on
viewport resize.

Thanks,
-- 
Loïc Molinari <[EMAIL PROTECTED]>
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [EMAIL PROTECTED]
# target_branch: lp:elisa
# testament_sha1: e4165a088188ac3d8ba585822234e487c14f207c
# timestamp: 2008-06-16 19:18:37 +0200
# base_revision_id: [EMAIL PROTECTED]
#   g2vufqah2m976cp4
# 
# Begin patch
=== modified file 'elisa-plugins/elisa/plugins/pigment/pigment_frontend.py'
--- elisa-plugins/elisa/plugins/pigment/pigment_frontend.py	2008-06-02 15:55:47 +0000
+++ elisa-plugins/elisa/plugins/pigment/pigment_frontend.py	2008-06-16 17:17:43 +0000
@@ -27,6 +27,7 @@
 from twisted.internet import reactor, task, defer
 import os
 import pgm
+from pgm.timing import controller, ticker
 import pkg_resources
 
 class ControllerNotFound(Exception):
@@ -309,11 +310,22 @@
             viewport.fullscreen = fullscreen
             viewport.show()
 
+            # Pigment configure events are sent on window move/resize. This
+            # callback allows to regenerate our texts considering the new
+            # window size.
             self._resize_delay = 0.2
             self._resize_delayed = None
             id = viewport.connect('configure-event', self._configure_callback)
             self._signal_handler_ids.append(id)
 
+        # Update animations in the viewport 'update-pass' signal. This is the
+        # best solution to update Pigment animations because it's synchronized
+        # with the rendering. Note that this is the only Pigment signal which
+        # is emitted in another thread than the mainloop one.
+        tck = ticker.Ticker()
+        controller.Controller.set_ticker(tck)
+        id = viewport.connect('update-pass', self._upate_pass_callback, tck)
+        self._signal_handler_ids.append(id)
 
         # hide the cursor
         viewport.cursor = pgm.VIEWPORT_NONE
@@ -372,6 +384,9 @@
             self._resize_delayed = reactor.callLater(self._resize_delay,
                                                      self._resize_canvas)
 
+    def _upate_pass_callback(self, viewport, ticker):
+        ticker.tick()
+
     def _resize_canvas(self):
         if self._viewport_size != self.viewport.size:
             self.debug("regeneration the canvas")

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWVsreaEAA23/lERQAAFZ5///
ewdGAL////AAAIgAYAcvh0AAAAAAAAEIk9E09EDJoZNDTTRpoYTQ0DRiGg5piZMmjCYJiaYBMAhg
jAjANUnoyj9SaBoDI00Bpk0PUDTIDQDDmmJkyaMJgmJpgEwCGCMCMBzTEyZNGEwTE0wCYBDBGBGA
SRCaAE0NTAmjJlGKZDSeRo0T0NEGERPfwMFyhOCyIHsB3x4iRgVojWThylUFVxLzUU2ZELoCoAwt
AxfqwpjBpAaGSOb0kyJ0WdMu6M5WbEAqQD6/Pa9fINxgMMMg/iYrpyJpkRTRZWu97K94UEQxm59N
xZbr4c/tA3w/aqjJquJQORgzRUtRWfQuI0SKnJllJIhnX9YHOR9SiMDAYPAh51NY9uiiYWYkhAsG
zIWIyDEErgKrl5KsCIgc9kN33GkjCDhoPA6zNQ90HhxncCjGJwIgj09BmZv45dTMNjnvHKt5uJQh
KI0D06wlHxGennmIcXcHQMBGAuBsD2+a6HALAGKrvKHjLe0liGw6BkbBSLDaGjVc7v+Id/JwgxCg
V4yZkebLNGgeAJSUV4mcCAju4ii4SVAiEQRYdCmsQmFNWGZ+Aj0gWETSEinARaxhEnWVLX/0qJEU
j19CrRrHcrI+/UhVfEZjmFhQw0dBcpi7gyzCAqiIsd9ibEkFBZCzZjTWaxCgI0jYDDUxHNRrJjFO
hE6UpFQiBcaA8V4qlVFoisoE85KJIZOwiQ6WI5BVGuBRiSpRSPkYEj6niIvJ1GjpEK7sSQ+REIhp
CQuBUXGZVp6JqzSajUQtOAazMtKjSA1dJvDJEAydCnwfAy0O5MqrwNDwiRJZ0WkDWYky80CGrNTL
CgZIHFQXDVQC0wYKDUMWk56i7BMGBaMtYxgLWL+gtxjU1gQEZlo5DAcXGg0mpYmmo1WkRUGoXAKD
/BU6aSd2gQsaCN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