From fec37db06bbbdff79bc9816046a76e0b29e173b4 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 28 Jun 2011 11:05:05 +0200 Subject: Avoid redundant redraws on resize Use a global flag to record whether the terminal was resized instead of redrawing everything each time a KEY_RESIZE is read. Add some additional checks to help_write_pad() as invalid actions may be passed now due to using signals instead of virtual key presses. Signed-off-by: Lukas Fleischer --- src/calcurse.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/calcurse.c') diff --git a/src/calcurse.c b/src/calcurse.c index 15ee1bd..662f185 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -179,9 +179,7 @@ main (int argc, char **argv) break; case KEY_GENERIC_REDRAW: - case KEY_RESIZE: - do_update = 0; - wins_reset (); + resize = 1; break; case KEY_GENERIC_CHANGE_VIEW: @@ -567,6 +565,14 @@ main (int argc, char **argv) apoint_hilt_set (1); } } + + if (resize) + { + resize = 0; + do_update = 0; + wins_reset (); + } + if (do_update) wins_update (); } -- cgit v1.2.3-54-g00ecf