aboutsummaryrefslogtreecommitdiffstats
path: root/src/sigs.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-11-28 21:42:54 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2012-11-28 21:49:02 +0100
commit8ae75f3ca723d4d7e449c18f1704147b229ac66c (patch)
treee8ba8f59bedbe6c2971223334b35182e34f03d16 /src/sigs.c
parent7f16e1c1d30f56d796b1e7f2286c9ccfdd97061f (diff)
downloadcalcurse-8ae75f3ca723d4d7e449c18f1704147b229ac66c.tar.gz
calcurse-8ae75f3ca723d4d7e449c18f1704147b229ac66c.zip
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/sigs.c')
-rw-r--r--src/sigs.c14
1 files changed, 14 insertions, 0 deletions
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);
+}