#include <curses.priv.h>
-MODULE_ID("$Id: lib_refresh.c,v 1.19 1998/02/11 12:13:59 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.24 1999/07/31 11:36:37 juergen Exp $")
int wrefresh(WINDOW *win)
{
int wnoutrefresh(WINDOW *win)
{
+short limit_x;
short i, j;
short begx;
short begy;
begx = win->_begx;
begy = win->_begy;
- /*
- * If 'newscr' has a different background than the window that we're
- * trying to refresh, we'll have to copy the whole thing.
- */
- if (win->_bkgd != newscr->_bkgd) {
- touchwin(win);
- newscr->_bkgd = win->_bkgd;
- }
+ newscr->_bkgd = win->_bkgd;
newscr->_attrs = win->_attrs;
/* merge in change information from all subwindows of this window */
* common-subexpression chunking to make it really tense,
* so we'll force the issue.
*/
+
+ /* limit(n) */
+ limit_x = win->_maxx;
+ /* limit(j) */
+ if (limit_x > win->_maxx)
+ limit_x = win->_maxx;
+
for (i = 0, m = begy + win->_yoffset;
i <= win->_maxy && m <= newscr->_maxy;
i++, m++) {
if (oline->firstchar != _NOCHANGE) {
int last = oline->lastchar;
- /* limit(j) */
- if (last > win->_maxx)
- last = win->_maxx;
- /* limit(n) */
- if (last > newscr->_maxx - begx)
- last = newscr->_maxx - begx;
+ if (last > limit_x)
+ last = limit_x;
for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) {
if (oline->text[j] != nline->text[n]) {
nline->text[n] = oline->text[j];
-
- if (nline->firstchar == _NOCHANGE)
- nline->firstchar = nline->lastchar = n;
- else if (n < nline->firstchar)
- nline->firstchar = n;
- else if (n > nline->lastchar)
- nline->lastchar = n;
+ CHANGED_CELL(nline, n);
}
}
newscr->_cury = win->_cury + win->_begy + win->_yoffset;
newscr->_curx = win->_curx + win->_begx;
}
+ newscr->_leaveok = win->_leaveok;
+
#ifdef TRACE
if (_nc_tracing & TRACE_UPDATE)
_tracedump("newscr", newscr);