summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2015-10-17 19:59:22 +0200
committernfnty <git@nfnty.se>2016-02-08 04:43:04 +0100
commit0e6ee82588abd0ff098b2e0cef0bd3ec88569689 (patch)
treef69a4a080d1833f11409f2282dec73a16821ed9f /ranger
parentbfbb84ff426810590be5e10f625a7f14ac75a3b2 (diff)
downloadranger-0e6ee82588abd0ff098b2e0cef0bd3ec88569689.tar.gz
VCS: Fix redraw race condition
Diffstat (limited to 'ranger')
-rw-r--r--ranger/ext/vcs/vcs.py3
-rw-r--r--ranger/gui/ui.py8
2 files changed, 6 insertions, 5 deletions
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index dd74ff82..8516bd71 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -393,7 +393,8 @@ class VcsThread(threading.Thread):
             if redraw:
                 redraw = False
                 for column in self.ui.browser.columns:
-                    column.need_redraw = True
+                    if column.target and column.target.is_directory:
+                        column.need_redraw = True
                 self.ui.status.need_redraw = True
                 self.ui.redraw()
             roots.clear()
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index f1e1ebbb..49c99777 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -42,6 +42,7 @@ class UI(DisplayableContainer):
         self.keybuffer = KeyBuffer()
         self.keymaps = KeyMaps(self.keybuffer)
         self.redrawlock = threading.Event()
+        self.redrawlock.set()
 
         if fm is not None:
             self.fm = fm
@@ -257,9 +258,8 @@ class UI(DisplayableContainer):
 
     def redraw(self):
         """Redraw all widgets"""
-        if self.redrawlock.is_set():
-            return
-        self.redrawlock.set()
+        self.redrawlock.wait()
+        self.redrawlock.clear()
         self.poke()
 
         # determine which widgets are shown
@@ -274,7 +274,7 @@ class UI(DisplayableContainer):
 
         self.draw()
         self.finalize()
-        self.redrawlock.clear()
+        self.redrawlock.set()
 
     def redraw_window(self):
         """Redraw the window. This only calls self.win.redrawwin()."""