suspension: fake a SIGWINCH when coming back out of the background

When receiving a SIGCONT, don't call regenerate_screen() directly
but act as if a SIGWINCH occurred.  Also insert a dummy key, and
thus let the relevant input routine redraw the relevant subwindows.

Use KEY_F0 as the dummy key, as both Ncurses and Slang know it, and
it should normally do nothing at all.

This fixes https://savannah.gnu.org/bugs/?51124.
master
Benno Schulenberg 2017-05-31 14:44:42 +02:00
parent 59b0f81bfa
commit a969adf804
2 changed files with 6 additions and 4 deletions

View File

@ -1267,9 +1267,10 @@ RETSIGTYPE do_continue(int signal)
#endif
#ifndef NANO_TINY
/* Perhaps the user resized the window while we slept. So act as if,
* and restore the terminal to its previous state in the process. */
regenerate_screen();
/* Perhaps the user resized the window while we slept. So set that
* flag, and tickle the input routine so that it will see the flag. */
the_window_resized = TRUE;
ungetch(KEY_F0);
#else
/* Restore the state of the terminal and redraw the whole screen. */
terminal_init();

View File

@ -701,8 +701,9 @@ int parse_kbinput(WINDOW *win)
#ifdef KEY_RESIZE
/* Slang and SunOS 5.7-5.9 don't support KEY_RESIZE. */
case KEY_RESIZE:
return ERR;
#endif
case KEY_F0:
return ERR;
}
return retval;