diff options
author | Frederic Culot <calcurse@culot.org> | 2007-10-07 17:13:10 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2007-10-07 17:13:10 +0000 |
commit | f3e8775cabbd82d006a17f860c49dc2cffeb80f1 (patch) | |
tree | 69ca04e5044b735a7c2ba778f5b5f434396f1ea2 | |
parent | 5e62e11e237b0048f225b9caff1729ce91cd0100 (diff) | |
download | calcurse-f3e8775cabbd82d006a17f860c49dc2cffeb80f1.zip |
Handling of SIGWINCH improved
-rwxr-xr-x | src/calcurse.c | 31 | ||||
-rwxr-xr-x | src/sigs.c | 5 |
2 files changed, 24 insertions, 12 deletions
diff --git a/src/calcurse.c b/src/calcurse.c index f11215c..b8ad8b4 100755 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -1,4 +1,4 @@ -/* $calcurse: calcurse.c,v 1.55 2007/08/19 13:15:55 culot Exp $ */ +/* $calcurse: calcurse.c,v 1.56 2007/10/07 17:13:10 culot Exp $ */ /* * Calcurse - text-based organizer @@ -62,6 +62,7 @@ main(int argc, char **argv) int sav_hilt_tod = 0; struct sigaction sigact; bool do_storage = false; + bool do_update = true; bool day_changed = false; char *no_color_support = _("Sorry, colors are not supported by your terminal\n" @@ -157,11 +158,22 @@ main(int argc, char **argv) /* User input */ for (;;) { - - /* Get user input. */ + + do_update = true; ch = wgetch(swin); + switch (ch) { + case ERR: + do_update = false; + break; + + case CTRL('R'): + case KEY_RESIZE: + do_update = false; + wins_reset(); + break; + case 9: /* The TAB key was hit. */ reset_status_page(); /* Save previously highlighted event. */ @@ -199,11 +211,6 @@ main(int argc, char **argv) } break; - case CTRL('R'): - wins_reset(); - do_storage = true; - break; - case 'O': case 'o': other_status_page(wins_slctd()); @@ -447,6 +454,10 @@ main(int argc, char **argv) } else exit_calcurse(EXIT_SUCCESS); break; + + default: + do_update = false; + break; } if (do_storage) { @@ -461,7 +472,7 @@ main(int argc, char **argv) apoint_hilt_set(1); } } - - wins_update(); + if (do_update) + wins_update(); } } @@ -1,4 +1,4 @@ -/* $Id: sigs.c,v 1.3 2007/08/15 15:30:17 culot Exp $ */ +/* $Id: sigs.c,v 1.4 2007/10/07 17:13:10 culot Exp $ */ /* * Calcurse - text-based organizer @@ -48,7 +48,8 @@ signal_handler(int sig) ; break; case SIGWINCH: - wins_reset(); + clearok(curscr, TRUE); + ungetch(KEY_RESIZE); break; } } |