diff --git a/src/ChangeLog b/src/ChangeLog index 0d7db2339..4287bfe62 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-07-03 Pavel Roskin + * main.c (stop_dialogs): New function to stop all dialogs. + (quit_cmd_internal): Use stop_dialogs() instead of stopping + midnight_dlg only. This fixes exit from the shell invoked from + the internal viewer or editor. + * cmd.c (view_other_cmd): Shut down extra select channels before switching to the shell. Restore them afterwards, but not if quit was requested. Skip more code on quit. diff --git a/src/main.c b/src/main.c index 28482f133..c4c79f68f 100644 --- a/src/main.c +++ b/src/main.c @@ -761,6 +761,16 @@ change_panel (void) dlg_one_down (midnight_dlg); } +/* Stop MC main dialog and the current dialog if it exists. + * Needed to provide fast exit from MC viewer or editor on shell exit */ +static void stop_dialogs (void) +{ + midnight_dlg->running = 0; + if (current_dlg) { + current_dlg->running = 0; + } +} + static int quit_cmd_internal (int quiet) { @@ -777,11 +787,11 @@ quit_cmd_internal (int quiet) if (q){ #ifdef HAVE_SUBSHELL_SUPPORT if (!use_subshell) - midnight_dlg->running = 0; + stop_dialogs (); else if ((q = exit_subshell ())) #endif - midnight_dlg->running = 0; + stop_dialogs (); } if (q) quit |= 1;