Ticket #3639: fix window resizing when panels are hidden.
commitf278eaec99320874b112b37d9925d78d964f5d37
authorYuri Khan <yurivkhan@gmail.com>
Tue, 3 May 2016 05:51:40 +0000 (3 11:51 +0600)
committerAndrew Borodin <aborodin@vmail.ru>
Thu, 5 May 2016 06:56:21 +0000 (5 09:56 +0300)
tree81f569fba1f4c16d2d1a7b05bac702f179d136cd
parent30cf792a49c2fffc0f7e15bb85f2d70f19974d7f
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>
src/subshell/common.c