Commit a969adf8 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
...@@ -1267,9 +1267,10 @@ RETSIGTYPE do_continue(int signal) ...@@ -1267,9 +1267,10 @@ RETSIGTYPE do_continue(int signal)
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
/* Perhaps the user resized the window while we slept. So act as if, /* Perhaps the user resized the window while we slept. So set that
* and restore the terminal to its previous state in the process. */ * flag, and tickle the input routine so that it will see the flag. */
regenerate_screen(); the_window_resized = TRUE;
ungetch(KEY_F0);
#else #else
/* Restore the state of the terminal and redraw the whole screen. */ /* Restore the state of the terminal and redraw the whole screen. */
terminal_init(); terminal_init();
......
...@@ -701,8 +701,9 @@ int parse_kbinput(WINDOW *win) ...@@ -701,8 +701,9 @@ int parse_kbinput(WINDOW *win)
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
/* Slang and SunOS 5.7-5.9 don't support KEY_RESIZE. */ /* Slang and SunOS 5.7-5.9 don't support KEY_RESIZE. */
case KEY_RESIZE: case KEY_RESIZE:
return ERR;
#endif #endif
case KEY_F0:
return ERR;
} }
return retval; return retval;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment