Ticket #3639: fix window resizing when panels are hidden.

Calling tty_change_screen_size() causes a switch to the alternate screen:

   * Resizing the window causes a SIGWINCH sent to the mc process.
   * sigwinch_handler() sets the flag mc_global.tty.winch_flag to 1.
   * The select() call in feed_subshell() is interrupted.
   * feed_subshell() notices the winch_flag and calls tty_change_screen_size().
   * tty_change_screen_size() calls SLsmg_reinit_smg().
   * SLsmg_reinit_smg() sees that Smg_Mode is currently SMG_MODE_NONE
     (because it was set that way back in reset_smg() that was called
     when panels were hidden).
   * SLsmg_reinit_smg() calls SLsmg_init_smg().
   * SLsmg_init_smg() calls init_smg_for_mode(SMG_MODE_FULLSCREEN).
   * init_smg_for_mode() calls SLtt_init_video().
   * SLtt_init_video() sends the smcup terminfo sequence to the terminal.
   * SLtt_init_video() calls SLtt_init_keypad().
   * SLtt_init_keypad() sends the smkx terminfo sequence to the terminal
     and flushes the output buffer. (If $TERM starts with xterm or exactly
     matches screen, this function returns immediately without flushing the
     buffer, so the issue will not be visible.) The terminal switches to
     alternate screen and clears it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Yuri Khan 2016-05-03 11:51:40 +06:00 committed by Andrew Borodin
parent 30cf792a49
commit f278eaec99
1 changed files with 1 additions and 1 deletions

View File

@ -531,7 +531,7 @@ feed_subshell (int how, int fail_on_error)
/* Despite using SA_RESTART, we still have to check for this */
if (errno == EINTR)
{
if (mc_global.tty.winch_flag != 0)
if (how == QUIETLY && mc_global.tty.winch_flag != 0)
tty_change_screen_size ();
continue; /* try all over again */