From e64fbb87ec0b4d36f2d47d0b0bcbcd3f5f7d2918 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 7 Nov 2015 20:39:12 +0100 Subject: [PATCH] New client: Only redraw screen when content change can be assumed. --- client_prototype.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client_prototype.py b/client_prototype.py index b5c7f59..9a67b98 100644 --- a/client_prototype.py +++ b/client_prototype.py @@ -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() -- 2.30.2