From f28fffedba2ee8dec2b0ab2795636bc5b86caed4 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 28 Mar 2011 16:45:50 +0400 Subject: [PATCH] Ticket #2520: SIGINT generated by Ctrl-g pressing closes file panels. When SIGINT signal is raised, the CK_DialogCancel message is handled by dlg_execute_cmd() and midnight_dlg is closed. The solution: CK_DialogCancel is sent to current dialog via callback, and if current dialog doesn't handle CK_DialogCancel message, then handle it with common way using dlg_execute_cmd(). Since Ctrl-g is used to generate SIGINT in MC, remove this shortcut from all sections of keymaps except the [dialog] section. Signed-off-by: Andrew Borodin --- lib/widget/dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index cb52c754a..873077483 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -1065,7 +1065,6 @@ init_dlg (Dlg_head * h) if ((top_dlg != NULL) && ((Dlg_head *) top_dlg->data)->modal) h->modal = TRUE; - /* add dialog to the stack */ top_dlg = g_list_prepend (top_dlg, h); @@ -1102,7 +1101,8 @@ dlg_process_event (Dlg_head * h, int key, Gpm_Event * event) if (key == EV_NONE) { if (tty_got_interrupt ()) - dlg_execute_cmd (h, CK_DialogCancel); + if (h->callback (h, NULL, DLG_ACTION, CK_DialogCancel, NULL) != MSG_HANDLED) + dlg_execute_cmd (h, CK_DialogCancel); return; } -- 2.11.4.GIT