Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-01-15 14:53:41 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-01-15 14:53:41 (GMT)
commit9c75c80d7f08187d0a585c3a2b86298f3c6eee27 (patch)
treeb775942ec189d9679c381f54267f84a3396adc92 /sugar
parentc30451b19ecf08018669e898a160652ea11f5fc9 (diff)
Don't clear the current buffer on cleanup
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/canvasicon.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py
index 2b38489..7da71f7 100644
--- a/sugar/graphics/canvasicon.py
+++ b/sugar/graphics/canvasicon.py
@@ -154,8 +154,10 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
self.connect('button-press-event', self._button_press_event_cb)
def _clear_buffers(self):
+ cur_buf_key = self._get_current_buffer_key()
for key in self._buffers.keys():
- del self._buffers[key]
+ if key != cur_buf_key:
+ del self._buffers[key]
self._buffers = {}
def do_set_property(self, pspec, value):
@@ -177,6 +179,9 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
elif pspec.name == 'cache':
self._cache = value
+ def _get_current_buffer_key(self):
+ return (self._icon_name, self._color, self._size)
+
def do_get_property(self, pspec):
if pspec.name == 'size':
return self._size
@@ -188,8 +193,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
return self._cache
def _get_buffer(self, cr, handle):
- key = (self._icon_name, self._color, self._size)
-
+ key = self._get_current_buffer_key()
buf = None
if self._buffers.has_key(key):
buf = self._buffers[key]