From 8ae75f3ca723d4d7e449c18f1704147b229ac66c Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 28 Nov 2012 21:42:54 +0100 Subject: Ignore signals during command execution Disable signal handlers in wins_prepare_external() and reactivate them in wins_unprepare_external(). Before, it was possible that resizing the window during editor/pager mode resulted in the calcurse main screen appearing on top. Addresses BUG#9. Signed-off-by: Lukas Fleischer --- src/sigs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/sigs.c') diff --git a/src/sigs.c b/src/sigs.c index 4cc01bf..77ef6b8 100644 --- a/src/sigs.c +++ b/src/sigs.c @@ -108,3 +108,17 @@ void sigs_init() || !sigs_set_hdlr(SIGINT, SIG_IGN)) exit_calcurse(1); } + +/* Ignore SIGWINCH and SIGTERM signals. */ +void sigs_ignore(void) +{ + sigs_set_hdlr(SIGWINCH, SIG_IGN); + sigs_set_hdlr(SIGTERM, SIG_IGN); +} + +/* No longer ignore SIGWINCH and SIGTERM signals. */ +void sigs_unignore(void) +{ + sigs_set_hdlr(SIGWINCH, generic_hdlr); + sigs_set_hdlr(SIGTERM, generic_hdlr); +} -- cgit v1.2.3-54-g00ecf