OSDN Git Service

add_relayout to thread_view is called in a critical section.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Fri, 10 Apr 2009 15:29:19 +0000 (00:29 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Fri, 10 Apr 2009 15:29:19 +0000 (00:29 +0900)
queue_draw is expensive, so do not use in a loop.

src/FukuiNoNamari/thread_view.py
src/FukuiNoNamari/thread_window.py

index dd13da1..23f151a 100644 (file)
@@ -543,7 +543,8 @@ class ThreadView(gtk.HBox):
 
         x, y = res_layout.get_pixel_size()
         self.adjustment.upper = res_layout.posY + y
-        self.redraw()
+        # do not use this method in a loop because expensive.
+        # self.redraw()
         self.change_vscrollbar_visible()
 
     def create_res_layout(self, left_margin, resnum):
index 6a9f50d..0583cae 100644 (file)
@@ -111,7 +111,10 @@ class HTMLParserToThreadView:
 
     def to_thread_view(self):
         if self.layout is not None:
-            gobject.idle_add(self.threadview.add_layout, self.layout)
+            # gobject.idle_add(self.threadview.add_layout, self.layout)
+            gtk.gdk.threads_enter()
+            self.threadview.add_layout(self.layout)
+            gtk.gdk.threads_leave()
             self.initialize()