Module Name:    src
Committed By:   uwe
Date:           Mon Jul  6 23:33:38 UTC 2020

Modified Files:
        src/lib/libcurses: get_wch.c getch.c

Log Message:
Pads are not to be automatically refreshed on input.

X/Open Curses says in the documentation for newpad():

  Automatic refreshes of pads (e.g., from scrolling or echoing of
  input) do not occur.

And in the documentation for get*():

  If the current or specified window is not a pad, and it has been
  moved or modified since the last refresh operation, then it will be
  refreshed before another character is read.

>From Michael Forney in PR lib/55457


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.74 -r1.75 src/lib/libcurses/getch.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/get_wch.c
diff -u src/lib/libcurses/get_wch.c:1.23 src/lib/libcurses/get_wch.c:1.24
--- src/lib/libcurses/get_wch.c:1.23	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/get_wch.c	Mon Jul  6 23:33:38 2020
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.23 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: get_wch.c,v 1.24 2020/07/06 23:33:38 uwe Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: get_wch.c,v 1.23 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.24 2020/07/06 23:33:38 uwe Exp $");
 #endif						  /* not lint */
 
 #include <errno.h>
@@ -499,7 +499,7 @@ wget_wch(WINDOW *win, wint_t *ch)
 	    && __echoit)
 		return ERR;
 
-	if (is_wintouched(win))
+	if (!(win->flags & __ISPAD) && is_wintouched(win))
 		wrefresh(win);
 #ifdef DEBUG
 	__CTRACE(__CTRACE_INPUT, "wget_wch: __echoit = %d, "

Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.74 src/lib/libcurses/getch.c:1.75
--- src/lib/libcurses/getch.c:1.74	Thu May 14 11:50:04 2020
+++ src/lib/libcurses/getch.c	Mon Jul  6 23:33:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: getch.c,v 1.74 2020/05/14 11:50:04 simonb Exp $	*/
+/*	$NetBSD: getch.c,v 1.75 2020/07/06 23:33:38 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getch.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getch.c,v 1.74 2020/05/14 11:50:04 simonb Exp $");
+__RCSID("$NetBSD: getch.c,v 1.75 2020/07/06 23:33:38 uwe Exp $");
 #endif
 #endif					/* not lint */
 
@@ -818,11 +818,11 @@ wgetch(WINDOW *win)
 	    && __echoit)
 		return ERR;
 
-	if (is_wintouched(win))
-		wrefresh(win);
-	else {
-		if ((_cursesi_screen->curscr->cury != (win->begy + win->cury))
-		    || (_cursesi_screen->curscr->curx != (win->begx + win->curx))) {
+	if (!(win->flags & __ISPAD)) {
+		if (is_wintouched(win))
+			wrefresh(win);
+		else if ((_cursesi_screen->curscr->cury != (win->begy + win->cury))
+		         || (_cursesi_screen->curscr->curx != (win->begx + win->curx))) {
 #ifdef DEBUG
 			__CTRACE(__CTRACE_INPUT, "wgetch: curscr cury %d cury %d curscr curx %d curx %d\n",
 			_cursesi_screen->curscr->cury, win->begy + win->cury,

Reply via email to