Module Name:    src
Committed By:   martin
Date:           Tue Oct  9 09:49:35 UTC 2018

Modified Files:
        src/lib/libcurses [netbsd-8]: newwin.c refresh.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #1049):

        lib/libcurses/refresh.c: revision 1.89
        lib/libcurses/newwin.c: revision 1.53

curses: allow drawing the lowest right hand cell of the terminal

This is a historical behaviour that needs fixing
If any terminal does scroll when drawing in the lowest right hand cell
of the terminal then an entry should be made in the terminfo database
(currently there is no standard code) to state that and define
__SCROLLWIN as before.

Fixes PR# 30978.


To generate a diff of this commit:
cvs rdiff -u -r1.50.6.1 -r1.50.6.2 src/lib/libcurses/newwin.c
cvs rdiff -u -r1.88 -r1.88.4.1 src/lib/libcurses/refresh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/newwin.c
diff -u src/lib/libcurses/newwin.c:1.50.6.1 src/lib/libcurses/newwin.c:1.50.6.2
--- src/lib/libcurses/newwin.c:1.50.6.1	Thu Oct  4 10:20:12 2018
+++ src/lib/libcurses/newwin.c	Tue Oct  9 09:49:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: newwin.c,v 1.50.6.1 2018/10/04 10:20:12 martin Exp $	*/
+/*	$NetBSD: newwin.c,v 1.50.6.2 2018/10/09 09:49:35 martin Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)newwin.c	8.3 (Berkeley) 7/27/94";
 #else
-__RCSID("$NetBSD: newwin.c,v 1.50.6.1 2018/10/04 10:20:12 martin Exp $");
+__RCSID("$NetBSD: newwin.c,v 1.50.6.2 2018/10/09 09:49:35 martin Exp $");
 #endif
 #endif				/* not lint */
 
@@ -422,8 +422,14 @@ __swflags(WINDOW *win)
 		win->flags |= __ENDLINE;
 		if (win->begx == 0 && win->maxy == LINES && win->begy == 0)
 			win->flags |= __FULLWIN;
+		/*
+		 * Enable this if we have a terminfo setting which claims
+		 * terminal will scroll. Currently there is none.
+		 */
+#if 0
 		if (win->begy + win->maxy == LINES)
 			win->flags |= __SCROLLWIN;
+#endif
 	}
 }
 

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.88 src/lib/libcurses/refresh.c:1.88.4.1
--- src/lib/libcurses/refresh.c:1.88	Mon Mar 20 20:42:39 2017
+++ src/lib/libcurses/refresh.c	Tue Oct  9 09:49:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.88 2017/03/20 20:42:39 christos Exp $	*/
+/*	$NetBSD: refresh.c,v 1.88.4.1 2018/10/09 09:49:35 martin Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.88 2017/03/20 20:42:39 christos Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.88.4.1 2018/10/09 09:49:35 martin Exp $");
 #endif
 #endif				/* not lint */
 
@@ -1208,50 +1208,46 @@ makech(int wy)
 			wx++;
 			if (wx >= win->maxx &&
 			    wy == win->maxy - 1 && !_cursesi_screen->curwin) {
-				if (win->flags & __SCROLLOK) {
-					if (win->flags & __ENDLINE)
-						__unsetattr(1);
-					if (!(win->flags & __SCROLLWIN)) {
-						if (!_cursesi_screen->curwin) {
-							csp->attr = nsp->attr;
-							csp->ch = nsp->ch;
+				if (win->flags & __ENDLINE)
+					__unsetattr(1);
+				if (!(win->flags & __SCROLLWIN)) {
+					if (!_cursesi_screen->curwin) {
+						csp->attr = nsp->attr;
+						csp->ch = nsp->ch;
 #ifdef HAVE_WCHAR
-							if (_cursesi_copy_nsp(nsp->nsp, csp) == ERR)
-								return ERR;
+						if (_cursesi_copy_nsp(nsp->nsp, csp) == ERR)
+							return ERR;
 #endif /* HAVE_WCHAR */
-						}
+					}
 #ifndef HAVE_WCHAR
-						__cputchar((int) nsp->ch);
+					__cputchar((int) nsp->ch);
 #else
-						if ( WCOL( *nsp ) > 0 ) {
-							__cputwchar((int)nsp->ch);
+					if ( WCOL( *nsp ) > 0 ) {
+						__cputwchar((int)nsp->ch);
 #ifdef DEBUG
-							__CTRACE(__CTRACE_REFRESH,
-							    "makech: (%d,%d)putwchar(0x%x)\n",
-								wy, wx - 1,
-								nsp->ch );
+						__CTRACE(__CTRACE_REFRESH,
+						    "makech: (%d,%d)putwchar(0x%x)\n",
+							wy, wx - 1,
+							nsp->ch );
 #endif /* DEBUG */
-							/*
-							 * Output non-spacing
-							 * characters for the
-							 * cell.
-							 */
-							__cursesi_putnsp(nsp->nsp,
-									 wy, wx);
-
-						}
-#endif /* HAVE_WCHAR */
-					}
-					if (wx < curscr->maxx) {
-						domvcur(win,
-						    _cursesi_screen->ly, wx,
-						    (int)(win->maxy - 1),
-						    (int)(win->maxx - 1));
+						/*
+						 * Output non-spacing
+						 * characters for the
+						 * cell.
+						 */
+						__cursesi_putnsp(nsp->nsp, wy, wx);
 					}
-					_cursesi_screen->ly = win->maxy - 1;
-					_cursesi_screen->lx = win->maxx - 1;
-					return (OK);
+#endif /* HAVE_WCHAR */
 				}
+				if (wx < curscr->maxx) {
+					domvcur(win,
+					    _cursesi_screen->ly, wx,
+					    (int)(win->maxy - 1),
+					    (int)(win->maxx - 1));
+				}
+				_cursesi_screen->ly = win->maxy - 1;
+				_cursesi_screen->lx = win->maxx - 1;
+				return OK;
 			}
 			if (wx < win->maxx || wy < win->maxy - 1 ||
 			    !(win->flags & __SCROLLWIN))

Reply via email to