Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses curses: allow drawing the lowest right hand ce...



details:   https://anonhg.NetBSD.org/src/rev/f3760c36eaef
branches:  trunk
changeset: 836236:f3760c36eaef
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Oct 05 11:59:05 2018 +0000

description:
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.

diffstat:

 lib/libcurses/newwin.c  |  10 +++++-
 lib/libcurses/refresh.c |  78 +++++++++++++++++++++++-------------------------
 2 files changed, 45 insertions(+), 43 deletions(-)

diffs (137 lines):

diff -r 8626371dba83 -r f3760c36eaef lib/libcurses/newwin.c
--- a/lib/libcurses/newwin.c    Fri Oct 05 09:51:55 2018 +0000
+++ b/lib/libcurses/newwin.c    Fri Oct 05 11:59:05 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: newwin.c,v 1.52 2018/10/02 17:35:44 roy Exp $  */
+/*     $NetBSD: newwin.c,v 1.53 2018/10/05 11:59:05 roy 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.52 2018/10/02 17:35:44 roy Exp $");
+__RCSID("$NetBSD: newwin.c,v 1.53 2018/10/05 11:59:05 roy Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -422,8 +422,14 @@
                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
        }
 }
 
diff -r 8626371dba83 -r f3760c36eaef lib/libcurses/refresh.c
--- a/lib/libcurses/refresh.c   Fri Oct 05 09:51:55 2018 +0000
+++ b/lib/libcurses/refresh.c   Fri Oct 05 11:59:05 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.88 2017/03/20 20:42:39 christos Exp $    */
+/*     $NetBSD: refresh.c,v 1.89 2018/10/05 11:59:05 roy 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.89 2018/10/05 11:59:05 roy Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -1208,50 +1208,46 @@
                        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;
-#endif /* HAVE_WCHAR */
-                                               }
-#ifndef HAVE_WCHAR
-                                               __cputchar((int) nsp->ch);
-#else
-                                               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 );
-#endif /* DEBUG */
-                                                       /*
-                                                        * Output non-spacing
-                                                        * characters for the
-                                                        * cell.
-                                                        */
-                                                       __cursesi_putnsp(nsp->nsp,
-                                                                        wy, wx);
-
-                                               }
+                                               if (_cursesi_copy_nsp(nsp->nsp, csp) == ERR)
+                                                       return ERR;
 #endif /* HAVE_WCHAR */
                                        }
-                                       if (wx < curscr->maxx) {
-                                               domvcur(win,
-                                                   _cursesi_screen->ly, wx,
-                                                   (int)(win->maxy - 1),
-                                                   (int)(win->maxx - 1));
+#ifndef HAVE_WCHAR
+                                       __cputchar((int) nsp->ch);
+#else
+                                       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 );
+#endif /* DEBUG */
+                                               /*
+                                                * 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))



Home | Main Index | Thread Index | Old Index