diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-06-28 11:05:05 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-06-28 18:22:43 +0200 |
commit | fec37db06bbbdff79bc9816046a76e0b29e173b4 (patch) | |
tree | 2b7a6349b3bc7dd8c22be72518bb4576040e9596 /src/notify.c | |
parent | 6636232bc7bb3148ca82dcac3e52ce02212f4b68 (diff) | |
download | calcurse-fec37db06bbbdff79bc9816046a76e0b29e173b4.zip |
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/notify.c')
-rw-r--r-- | src/notify.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/notify.c b/src/notify.c index d66cf80..14a5f0c 100644 --- a/src/notify.c +++ b/src/notify.c @@ -728,20 +728,6 @@ notify_config_bar (void) switch (ch) { - case KEY_RESIZE: - wins_get_config (); - wins_reset (); - reinit_conf_win (&cwin); - delwin (win[STA].p); - win[STA].p = newwin (win[STA].h, win[STA].w, win[STA].y, - win[STA].x); - keypad (win[STA].p, TRUE); - if (notify_bar ()) - { - notify_reinit_bar (); - notify_update_bar (); - } - break; case CTRL ('N'): wins_scrollwin_down (&cwin, 1); break; @@ -815,6 +801,25 @@ notify_config_bar (void) dmon.log = !dmon.log; break; } + + if (resize) + { + resize = 0; + wins_get_config (); + wins_reset (); + reinit_conf_win (&cwin); + delwin (win[STA].p); + win[STA].p = newwin (win[STA].h, win[STA].w, win[STA].y, + win[STA].x); + keypad (win[STA].p, TRUE); + if (notify_bar ()) + { + notify_reinit_bar (); + notify_update_bar (); + } + clearok (curscr, TRUE); + } + status_mesg (number_str, keys); cwin.total_lines = print_config_options (cwin.pad.p); wins_scrollwin_display (&cwin); |