[tor-commits] [nyx/master] Interface initially rendered incorrectly

atagar at torproject.org atagar at torproject.org
Wed Sep 13 19:56:37 UTC 2017


commit 2cfd31b61b571dde0a532e2646e9f3415d1cd966
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed Sep 13 12:54:42 2017 -0700

    Interface initially rendered incorrectly
    
    Our daemon panels draw themselves. Since we started them before calling
    redraw() the first time (which sets the 'top' positions of panels) we
    rendered things out of place.
    
    This caused our log to render where the header panel should be for a
    few seconds when we started up.
---
 nyx/__init__.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/nyx/__init__.py b/nyx/__init__.py
index c5736c1..745ce31 100644
--- a/nyx/__init__.py
+++ b/nyx/__init__.py
@@ -155,6 +155,15 @@ def draw_loop():
   interface = nyx_interface()
   next_key = None  # use this as the next user input
 
+  # Redrawing before starting daemons is important so our interface is rendered
+  # right away and the 'top' positions are set for our panels.
+
+  interface.redraw()
+
+  for panel in interface:
+    if isinstance(panel, nyx.panel.DaemonPanel):
+      panel.start()
+
   stem.util.log.info('nyx started (initialization took %0.1f seconds)' % (time.time() - CONFIG['start_time']))
 
   while not interface._quit:
@@ -567,9 +576,6 @@ class Interface(object):
     for panel in self:
       panel.set_visible(panel in visible_panels)
 
-      if isinstance(panel, nyx.panel.DaemonPanel):
-        panel.start()
-
   def get_page(self):
     """
     Provides the page we're showing.



More information about the tor-commits mailing list