diff cagou/plugins/plugin_wid_chat.py @ 265:805c4103dac5

core: resync widgets only when they are visible: using AUTO_RESYNC from QuickApp was causing performance trouble (resynchronising all widgets was freezing the frontend for a little while). By resynchronising only when the widget is visible, this should be greatly improved.
author Goffi <goffi@goffi.org>
date Mon, 11 Mar 2019 08:39:43 +0100
parents a579eda31f4f
children a0835f0212d8
line wrap: on
line diff
--- a/cagou/plugins/plugin_wid_chat.py	Mon Mar 11 08:39:43 2019 +0100
+++ b/cagou/plugins/plugin_wid_chat.py	Mon Mar 11 08:39:43 2019 +0100
@@ -678,6 +678,10 @@
         self.encryption_btn.symbol = self.encryption_btn.getSymbol()
         self.encryption_btn.color = self.encryption_btn.getColor()
 
+    def onVisible(self):
+        if not self.sync:
+            self.resync()
+
     def onDelete(self):
         # we always keep one widget, so it's available when swiping
         # TODO: delete all widgets when chat is closed