home · contact · privacy
New client: Only redraw screen when content change can be assumed.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 7 Nov 2015 19:39:12 +0000 (20:39 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 7 Nov 2015 19:39:12 +0000 (20:39 +0100)
client_prototype.py

index b5c7f599cef90242632e84cfb5a174d150213d89..9a67b98d0e0ac54d72de916b5aa0ec6ef21d2dfe 100644 (file)
@@ -79,6 +79,7 @@ def set_window_geometries():
     for win in windows:
         set_window_size()
         place_window()
+    cursed_main.redraw = True
 
 
 def draw_screen():
@@ -195,11 +196,14 @@ def cursed_main(stdscr):
     while True:
         stdscr.timeout(delay)
         delay = delay * 2 if delay < 1000 else delay
-        draw_screen()
+        if cursed_main.redraw:
+            draw_screen()
+            cursed_main.redraw = False
         char = stdscr.getch()
         if (char >= 0):
             if chr(char) in commands:
                 commands[chr(char)]()
+                cursed_main.redraw = True
         test_and_poll_server()