Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses Rework previous fix for getch cursor position ...
details: https://anonhg.NetBSD.org/src/rev/f110d2310267
branches: trunk
changeset: 451865:f110d2310267
user: blymn <blymn%NetBSD.org@localhost>
date: Sun Jun 09 07:40:14 2019 +0000
description:
Rework previous fix for getch cursor position when cursor is moved
without refresh. If the window is not dirty but the window cursor
position does not match curscr then move the cursor. This fixes
the issues seen in PR lib/54263.
diffstat:
lib/libcurses/add_wch.c | 6 +++---
lib/libcurses/add_wchstr.c | 6 +++---
lib/libcurses/addbytes.c | 20 +++++++-------------
lib/libcurses/addch.c | 6 +++---
lib/libcurses/addchnstr.c | 8 ++++----
lib/libcurses/addnstr.c | 6 +++---
lib/libcurses/addwstr.c | 6 +++---
lib/libcurses/copywin.c | 6 +++---
lib/libcurses/curses_private.h | 4 +---
lib/libcurses/delch.c | 6 +++---
lib/libcurses/erase.c | 6 +++---
lib/libcurses/get_wch.c | 8 ++++----
lib/libcurses/get_wstr.c | 24 ++++++++++++------------
lib/libcurses/getch.c | 25 +++++++++++++------------
lib/libcurses/getstr.c | 24 ++++++++++++------------
lib/libcurses/in_wch.c | 6 +++---
lib/libcurses/in_wchstr.c | 8 ++++----
lib/libcurses/inch.c | 6 +++---
lib/libcurses/inchstr.c | 8 ++++----
lib/libcurses/ins_wch.c | 6 +++---
lib/libcurses/ins_wstr.c | 8 ++++----
lib/libcurses/insch.c | 7 +++----
lib/libcurses/insstr.c | 8 ++++----
lib/libcurses/instr.c | 8 ++++----
lib/libcurses/inwstr.c | 8 ++++----
lib/libcurses/line.c | 20 ++++++++++----------
lib/libcurses/move.c | 29 ++++++-----------------------
lib/libcurses/newwin.c | 6 +++---
lib/libcurses/printw.c | 6 +++---
lib/libcurses/refresh.c | 15 ++++++---------
lib/libcurses/scroll.c | 6 +++---
31 files changed, 144 insertions(+), 172 deletions(-)
diffs (truncated from 1284 to 300 lines):
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/add_wch.c
--- a/lib/libcurses/add_wch.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/add_wch.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add_wch.c,v 1.8 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: add_wch.c,v 1.9 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: add_wch.c,v 1.8 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: add_wch.c,v 1.9 2019/06/09 07:40:14 blymn Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -76,7 +76,7 @@
int
mvwadd_wch(WINDOW *win, int y, int x, const cchar_t *wch)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return wadd_wch(win, wch);
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/add_wchstr.c
--- a/lib/libcurses/add_wchstr.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/add_wchstr.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add_wchstr.c,v 1.7 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: add_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: add_wchstr.c,v 1.7 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: add_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -120,7 +120,7 @@
int
mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wchstr, int n)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return wadd_wchnstr(win, wchstr, n);
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/addbytes.c
--- a/lib/libcurses/addbytes.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/addbytes.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addbytes.c,v 1.51 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: addbytes.c,v 1.52 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 1987, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: addbytes.c,v 1.51 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.52 2019/06/09 07:40:14 blymn Exp $");
#endif
#endif /* not lint */
@@ -47,9 +47,9 @@
#endif
#define SYNCH_IN {y = win->cury; x = win->curx;}
-#define SYNCH_OUT {win->cury = y; win->curx = x; win->ocury = y; win->ocurx = x;}
+#define SYNCH_OUT {win->cury = y; win->curx = x;}
#define PSYNCH_IN {*y = win->cury; *x = win->curx;}
-#define PSYNCH_OUT {win->cury = *y; win->curx = *x; win->ocury = *y; win->ocurx = *x;}
+#define PSYNCH_OUT {win->cury = *y; win->curx = *x;}
#ifndef _CURSES_USE_MACROS
@@ -94,7 +94,7 @@
mvwaddbytes(WINDOW *win, int y, int x, const char *bytes, int count)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return _cursesi_waddbytes(win, bytes, count, 0, 1);
@@ -241,14 +241,12 @@
case '\r':
*x = 0;
win->curx = *x;
- win->ocurx = *x;
return OK;
case '\b':
if (--(*x) < 0)
*x = 0;
win->curx = *x;
- win->ocurx = *x;
return OK;
}
}
@@ -364,12 +362,10 @@
if (--*x < 0)
*x = 0;
win->curx = *x;
- win->ocurx = *x;
return OK;
case L'\r':
*x = 0;
win->curx = *x;
- win->ocurx = *x;
return OK;
case L'\n':
wclrtoeol(win);
@@ -512,7 +508,6 @@
(*lnp) = win->alines[*y];
}
win->cury = *y;
- win->ocury = *y;
/* add spacing character */
#ifdef DEBUG
@@ -602,11 +597,10 @@
}
lp = &win->alines[*y]->line[0];
(*lnp) = win->alines[*y];
- win->curx = win->ocurx = *x;
- win->cury = win->ocury = *y;
+ win->curx = *x;
+ win->cury = *y;
} else {
win->curx = *x;
- win->ocurx = *x;
/* clear the remining of the current characer */
if (*x && *x < win->maxx) {
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/addch.c
--- a/lib/libcurses/addch.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/addch.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addch.c,v 1.20 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: addch.c,v 1.21 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)addch.c 8.2 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: addch.c,v 1.20 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: addch.c,v 1.21 2019/06/09 07:40:14 blymn Exp $");
#endif
#endif /* not lint */
@@ -74,7 +74,7 @@
mvwaddch(WINDOW *win, int y, int x, chtype ch)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return waddch(win, ch);
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/addchnstr.c
--- a/lib/libcurses/addchnstr.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/addchnstr.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addchnstr.c,v 1.7 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: addchnstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: addchnstr.c,v 1.7 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: addchnstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -111,7 +111,7 @@
int
mvwaddchnstr(WINDOW *win, int y, int x, const chtype *chstr, int n)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return waddchnstr(win, chstr, n);
@@ -180,6 +180,6 @@
*cp = '\0';
ret = _cursesi_waddbytes(win, start, i, attr, 0);
free(ocp);
- _cursesi_wmove(win, oy, ox, 1);
+ wmove(win, oy, ox);
return ret;
}
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/addnstr.c
--- a/lib/libcurses/addnstr.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/addnstr.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addnstr.c,v 1.16 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: addnstr.c,v 1.17 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)addnstr.c 8.2 (Berkeley) 5/4/94";
#else
-__RCSID("$NetBSD: addnstr.c,v 1.16 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: addnstr.c,v 1.17 2019/06/09 07:40:14 blymn Exp $");
#endif
#endif /* not lint */
@@ -115,7 +115,7 @@
int
mvwaddnstr(WINDOW *win, int y, int x, const char *str, int count)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return waddnstr(win, str, count);
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/addwstr.c
--- a/lib/libcurses/addwstr.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/addwstr.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: addwstr.c,v 1.5 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: addwstr.c,v 1.6 2019/06/09 07:40:14 blymn Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: addwstr.c,v 1.5 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: addwstr.c,v 1.6 2019/06/09 07:40:14 blymn Exp $");
#endif /* not lint */
#include <string.h>
@@ -114,7 +114,7 @@
int
mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *str, int count)
{
- if (_cursesi_wmove(win, y, x, 0) == ERR)
+ if (wmove(win, y, x) == ERR)
return ERR;
return waddnwstr(win, str, count);
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/copywin.c
--- a/lib/libcurses/copywin.c Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/copywin.c Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copywin.c,v 1.18 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: copywin.c,v 1.19 2019/06/09 07:40:14 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: copywin.c,v 1.18 2019/05/20 22:17:41 blymn Exp $");
+__RCSID("$NetBSD: copywin.c,v 1.19 2019/06/09 07:40:14 blymn Exp $");
#endif /* not lint */
#include <ctype.h>
@@ -119,7 +119,7 @@
* background character
*/
if ((dooverlay && !isspace(sp->ch)) || !dooverlay) {
- _cursesi_wmove(dstwin, dminrow, dcol, 0);
+ wmove(dstwin, dminrow, dcol);
#ifdef DEBUG
__CTRACE(__CTRACE_WINDOW, "copywin: dcol = %d\n", dcol);
#endif
diff -r 778f98093df7 -r f110d2310267 lib/libcurses/curses_private.h
--- a/lib/libcurses/curses_private.h Sun Jun 09 01:56:49 2019 +0000
+++ b/lib/libcurses/curses_private.h Sun Jun 09 07:40:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: curses_private.h,v 1.70 2019/05/20 22:17:41 blymn Exp $ */
+/* $NetBSD: curses_private.h,v 1.71 2019/06/09 07:40:14 blymn Exp $ */
/*-
* Copyright (c) 1998-2000 Brett Lymn
@@ -111,7 +111,6 @@
struct __window *nextp, *orig; /* Subwindows list and parent. */
int begy, begx; /* Window home. */
int cury, curx; /* Current x, y coordinates. */
- int ocury, ocurx; /* Previous x, y coordinates. */
Home |
Main Index |
Thread Index |
Old Index