Commits

Anonymous committed 6c497e4

overlay: reduce flicker by only making one SHCNE_ASSOCCHANGE call

Comments (0)

Files changed (2)

TortoiseHgOverlayServer.py

             for r in sorted(roots):
                 try:
                     shlib.update_thgstatus(_ui, r, wait=False)
-                    shlib.shell_notify([r])
+                    shlib.shell_notify([r], noassoc=True)
                     logger.msg('Updated ' + r)
                 except (IOError, OSError):
                     print "IOError or OSError on updating %s (check permissions)" % r

tortoisehg/util/shlib.py

                 pass
         threading.Thread(target=start_browser).start()
 
-    def shell_notify(paths):
+    def shell_notify(paths, noassoc=False):
         try:
             from win32com.shell import shell, shellcon
             import pywintypes
             shell.SHChangeNotify(shellcon.SHCNE_UPDATEITEM,
                                  shellcon.SHCNF_IDLIST | shellcon.SHCNF_FLUSH,
                                  pidl, None)
-        shell.SHChangeNotify(shellcon.SHCNE_ASSOCCHANGED,
-                             shellcon.SHCNF_FLUSH,
-                             None, None)
+        if not noassoc:
+            shell.SHChangeNotify(shellcon.SHCNE_ASSOCCHANGED,
+                                 shellcon.SHCNF_FLUSH,
+                                 None, None)
 
     def update_thgstatus(ui, root, wait=False):
         '''Rewrite the file .hg/thgstatus
             f.rename()
 
 else:
-    def shell_notify(paths):
+    def shell_notify(paths, noassoc=False):
         if not paths:
             return
         notify = os.environ.get('THG_NOTIFY', '.tortoisehg/notify')