[tor-commits] [arm/master] fix: panel overlap if sighup toggles being a relay

atagar at torproject.org atagar at torproject.org
Tue Jul 12 21:36:33 UTC 2011


commit 121d0dfc41a8f65f6fe336a10c29f6d310f99468
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Jul 11 14:41:59 2011 -0700

    fix: panel overlap if sighup toggles being a relay
    
    If we sighup or reconnect to a tor instance and this toggles having an ORPort
    then the height of the header panel can change, causing overlap with the panel
    below it (this causes flickering of the overlapped content). Redrawing the
    whole display if this happens.
---
 src/cli/headerPanel.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/cli/headerPanel.py b/src/cli/headerPanel.py
index f80eff8..e64a6de 100644
--- a/src/cli/headerPanel.py
+++ b/src/cli/headerPanel.py
@@ -418,10 +418,19 @@ class HeaderPanel(panel.Panel, threading.Thread):
     """
     
     if eventType in (torTools.State.INIT, torTools.State.RESET):
+      initialHeight = self.getHeight()
       self._isTorConnected = True
       self._haltTime = None
       self._update(True)
-      self.redraw(True)
+      
+      if self.getHeight() != initialHeight:
+        # We're toggling between being a relay and client, causing the height
+        # of this panel to change. Redraw all content so we don't get
+        # overlapping content.
+        cli.controller.getController().requestRedraw(True)
+      else:
+        # just need to redraw ourselves
+        self.redraw(True)
     elif eventType == torTools.State.CLOSED:
       self._isTorConnected = False
       self._haltTime = time.time()





More information about the tor-commits mailing list