FreeBSD/usr.bin/talk/init_disp.c
/*
 * If we get SIGWINCH, recompute both window sizes and refresh things.
 */
If we get SIGWINCH, recompute both window sizes and refresh things.
If we get SIGWINCH recompute both window sizes and refresh things .
void
resize_display(void)
{
	struct winsize ws;
	if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) < 0 ||
	    (ws.ws_row == LINES && ws.ws_col == COLS))
		return;
	resizeterm(ws.ws_row, ws.ws_col);
	my_win.x_nlines = LINES / 2;
	my_win.x_ncols = COLS;
	wresize(my_win.x_win, my_win.x_nlines, my_win.x_ncols);
	mvwin(my_win.x_win, 0, 0);
	clearok(my_win.x_win, TRUE);
	his_win.x_nlines = LINES / 2 - 1;
	his_win.x_ncols = COLS;
	wresize(his_win.x_win, his_win.x_nlines, his_win.x_ncols);
	mvwin(his_win.x_win, my_win.x_nlines + 1, 0);
	clearok(his_win.x_win, TRUE);
	wresize(line_win, 1, COLS);
	mvwin(line_win, my_win.x_nlines, 0);
#if defined(NCURSES_VERSION) || defined(whline)
	whline(line_win, '-', COLS);
#else
	wmove(line_win, my_win.x_nlines, 0);
	box(line_win, '-', '-');
#endif
	wrefresh(his_win.x_win);
	wrefresh(line_win);
	wrefresh(my_win.x_win);
}
void resize_display ( void ) { struct winsize ws ; if ( ioctl ( STDIN_FILENO , TIOCGWINSZ , & ws ) < 0 || ( ws . ws_row == LINES && ws . ws_col == COLS ) ) return ; resizeterm ( ws . ws_row , ws . ws_col ) ; my_win . x_nlines = LINES / 2 ; my_win . x_ncols = COLS ; wresize ( my_win . x_win , my_win . x_nlines , my_win . x_ncols ) ; mvwin ( my_win . x_win , 0 , 0 ) ; clearok ( my_win . x_win , TRUE ) ; his_win . x_nlines = LINES / 2 - 1 ; his_win . x_ncols = COLS ; wresize ( his_win . x_win , his_win . x_nlines , his_win . x_ncols ) ; mvwin ( his_win . x_win , my_win . x_nlines + 1 , 0 ) ; clearok ( his_win . x_win , TRUE ) ; wresize ( line_win , 1 , COLS ) ; mvwin ( line_win , my_win . x_nlines , 0 ) ; #if defined ( NCURSES_VERSION ) || defined ( whline ) whline ( line_win , ' ' , COLS ) ; #else wmove ( line_win , my_win . x_nlines , 0 ) ; box ( line_win , ' ' , ' ' ) ; #endif wrefresh ( his_win . x_win ) ; wrefresh ( line_win ) ; wrefresh ( my_win . x_win ) ; }
If we get SIGWINCH, recompute both window sizes and refresh things.
If we get SIGWINCH recompute both window sizes and refresh things .
/* Update curses' internal state with new window size. */ /*
	 * Resize each window but wait to refresh the screen until
	 * everything has been drawn so the cursor is in the right spot.
	 */ /* Now redraw the screen. */