Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses curses: resizeterm(3) should always send KEY_R...
details: https://anonhg.NetBSD.org/src/rev/8e35283ad9b9
branches: trunk
changeset: 433694:8e35283ad9b9
user: roy <roy%NetBSD.org@localhost>
date: Fri Sep 28 15:03:48 2018 +0000
description:
curses: resizeterm(3) should always send KEY_RESIZE
Fixes #53636
OK kamil@
diffstat:
lib/libcurses/get_wch.c | 8 ++++----
lib/libcurses/getch.c | 8 ++++----
lib/libcurses/resize.c | 6 ++++--
3 files changed, 12 insertions(+), 10 deletions(-)
diffs (102 lines):
diff -r 0a217e637852 -r 8e35283ad9b9 lib/libcurses/get_wch.c
--- a/lib/libcurses/get_wch.c Fri Sep 28 15:03:34 2018 +0000
+++ b/lib/libcurses/get_wch.c Fri Sep 28 15:03:48 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: get_wch.c,v 1.18 2018/09/27 14:07:55 roy Exp $ */
+/* $NetBSD: get_wch.c,v 1.19 2018/09/28 15:03:48 roy 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.18 2018/09/27 14:07:55 roy Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.19 2018/09/28 15:03:48 roy Exp $");
#endif /* not lint */
#include <errno.h>
@@ -530,8 +530,8 @@
__echoit, __rawmode, _cursesi_screen->nl, win->flags);
#endif
if (_cursesi_screen->resized) {
+ resizeterm(LINES, COLS);
_cursesi_screen->resized = 0;
- resizeterm(LINES, COLS);
*ch = KEY_RESIZE;
return KEY_CODE_YES;
}
@@ -684,8 +684,8 @@
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "__fgetwc_resize returning KEY_RESIZE\n");
#endif
+ resizeterm(LINES, COLS);
_cursesi_screen->resized = 0;
- resizeterm(LINES, COLS);
*resized = true;
return c;
}
diff -r 0a217e637852 -r 8e35283ad9b9 lib/libcurses/getch.c
--- a/lib/libcurses/getch.c Fri Sep 28 15:03:34 2018 +0000
+++ b/lib/libcurses/getch.c Fri Sep 28 15:03:48 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getch.c,v 1.69 2018/09/27 14:07:55 roy Exp $ */
+/* $NetBSD: getch.c,v 1.70 2018/09/28 15:03:48 roy 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.69 2018/09/27 14:07:55 roy Exp $");
+__RCSID("$NetBSD: getch.c,v 1.70 2018/09/28 15:03:48 roy Exp $");
#endif
#endif /* not lint */
@@ -824,8 +824,8 @@
__echoit, __rawmode, _cursesi_screen->nl, win->flags, win->delay);
#endif
if (_cursesi_screen->resized) {
+ resizeterm(LINES, COLS);
_cursesi_screen->resized = 0;
- resizeterm(LINES, COLS);
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "wgetch returning KEY_RESIZE\n");
#endif
@@ -1013,7 +1013,7 @@
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "__fgetc_resize returning KEY_RESIZE\n");
#endif
+ resizeterm(LINES, COLS);
_cursesi_screen->resized = 0;
- resizeterm(LINES, COLS);
return KEY_RESIZE;
}
diff -r 0a217e637852 -r 8e35283ad9b9 lib/libcurses/resize.c
--- a/lib/libcurses/resize.c Fri Sep 28 15:03:34 2018 +0000
+++ b/lib/libcurses/resize.c Fri Sep 28 15:03:48 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: resize.c,v 1.26 2017/01/24 17:27:30 roy Exp $ */
+/* $NetBSD: resize.c,v 1.27 2018/09/28 15:03:48 roy Exp $ */
/*
* Copyright (c) 2001
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)resize.c blymn 2001/08/26";
#else
-__RCSID("$NetBSD: resize.c,v 1.26 2017/01/24 17:27:30 roy Exp $");
+__RCSID("$NetBSD: resize.c,v 1.27 2018/09/28 15:03:48 roy Exp $");
#endif
#endif /* not lint */
@@ -163,6 +163,8 @@
__CTRACE(__CTRACE_WINDOW, "resizeterm: (%d, %d)\n", nlines, ncols);
#endif
+ /* Unconditionally inform application screen has been resized. */
+ _cursesi_screen->resized = 1;
if (!is_term_resized(nlines, ncols))
return OK;
Home |
Main Index |
Thread Index |
Old Index