Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses curses: call resizeterm if getch issues KEY_RE...



details:   https://anonhg.NetBSD.org/src/rev/54e9c465c6b4
branches:  trunk
changeset: 433679:54e9c465c6b4
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Sep 27 14:07:55 2018 +0000

description:
curses: call resizeterm if getch issues KEY_RESIZE

This fixes PR #53633.

diffstat:

 lib/libcurses/get_wch.c |  6 ++++--
 lib/libcurses/getch.c   |  6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (67 lines):

diff -r a2f693399e74 -r 54e9c465c6b4 lib/libcurses/get_wch.c
--- a/lib/libcurses/get_wch.c   Thu Sep 27 14:05:26 2018 +0000
+++ b/lib/libcurses/get_wch.c   Thu Sep 27 14:07:55 2018 +0000
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.17 2018/09/27 14:05:26 roy Exp $ */
+/*   $NetBSD: get_wch.c,v 1.18 2018/09/27 14:07:55 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.17 2018/09/27 14:05:26 roy Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.18 2018/09/27 14:07:55 roy Exp $");
 #endif                                           /* not lint */
 
 #include <errno.h>
@@ -531,6 +531,7 @@
 #endif
        if (_cursesi_screen->resized) {
                _cursesi_screen->resized = 0;
+               resizeterm(LINES, COLS);
                *ch = KEY_RESIZE;
                return KEY_CODE_YES;
        }
@@ -684,6 +685,7 @@
        __CTRACE(__CTRACE_INPUT, "__fgetwc_resize returning KEY_RESIZE\n");
 #endif
        _cursesi_screen->resized = 0;
+       resizeterm(LINES, COLS);
        *resized = true;
        return c;
 }
diff -r a2f693399e74 -r 54e9c465c6b4 lib/libcurses/getch.c
--- a/lib/libcurses/getch.c     Thu Sep 27 14:05:26 2018 +0000
+++ b/lib/libcurses/getch.c     Thu Sep 27 14:07:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getch.c,v 1.68 2018/09/27 14:05:26 roy Exp $   */
+/*     $NetBSD: getch.c,v 1.69 2018/09/27 14:07:55 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.68 2018/09/27 14:05:26 roy Exp $");
+__RCSID("$NetBSD: getch.c,v 1.69 2018/09/27 14:07:55 roy Exp $");
 #endif
 #endif                                 /* not lint */
 
@@ -825,6 +825,7 @@
 #endif
        if (_cursesi_screen->resized) {
                _cursesi_screen->resized = 0;
+               resizeterm(LINES, COLS);
 #ifdef DEBUG
                __CTRACE(__CTRACE_INPUT, "wgetch returning KEY_RESIZE\n");
 #endif
@@ -1013,5 +1014,6 @@
        __CTRACE(__CTRACE_INPUT, "__fgetc_resize returning KEY_RESIZE\n");
 #endif
        _cursesi_screen->resized = 0;
+       resizeterm(LINES, COLS);
        return KEY_RESIZE;
 }



Home | Main Index | Thread Index | Old Index