Ticket #2520: SIGINT generated by Ctrl-g pressing closes file panels.

When SIGINT signal is raised, the CK_Cancel message is handled by
dlg_execute_cmd() and midnight_dlg is closed.

The solution: CK_Cancel is sent to current dialog via callback, and if
current dialog doesn't handle CK_Cancel 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 <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2011-03-28 16:45:50 +04:00
parent e1c933e1cb
commit f83bdadfa8

View File

@ -1067,7 +1067,6 @@ init_dlg (Dlg_head * h)
if ((top_dlg != NULL) && ((Dlg_head *) top_dlg->data)->modal) if ((top_dlg != NULL) && ((Dlg_head *) top_dlg->data)->modal)
h->modal = TRUE; h->modal = TRUE;
/* add dialog to the stack */ /* add dialog to the stack */
top_dlg = g_list_prepend (top_dlg, h); top_dlg = g_list_prepend (top_dlg, h);
@ -1104,6 +1103,7 @@ dlg_process_event (Dlg_head * h, int key, Gpm_Event * event)
if (key == EV_NONE) if (key == EV_NONE)
{ {
if (tty_got_interrupt ()) if (tty_got_interrupt ())
if (h->callback (h, NULL, DLG_ACTION, CK_Cancel, NULL) != MSG_HANDLED)
dlg_execute_cmd (h, CK_Cancel); dlg_execute_cmd (h, CK_Cancel);
return; return;