NetBSD-Bugs archive

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

lib/53633: curses(3) KEY_RESIZE does not update max y,x of stdscr



>Number:         53633
>Category:       lib
>Synopsis:       curses(3) KEY_RESIZE does not update max y,x of stdscr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 26 19:20:00 +0000 2018
>Originator:     Kamil Rytarowski
>Release:        NetBSD 8.99.25 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 8.99.25 NetBSD 8.99.25 (GENERIC) #0: Tue Sep 25 20:06:09 CEST 2018  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
getch(3) in curses(3) after catching KEY_RESIZE it does not update max Y,X size.

getmaxyx(3) in particular returns old size, from the state before resizing.
>How-To-Repeat:
#include <curses.h>
#include <stdio.h>

int
main(int argc, char **argv)
{
	int y1, x1;
	int y2, x2;
	int ch;

	initscr();

	keypad(stdscr, TRUE);

	getmaxyx(stdscr, y1, x1);

	do {
		ch = wgetch(stdscr);
		getmaxyx(stdscr, y2, x2);
	} while (ch != KEY_F(1));

	endwin();

	printf("ch = %d; (y1=%d,x1=%d)->(y2=%d,x2=%d)\n", ch, y1, x1, y2, x2);

	return 0;
}

>Fix:
N/A



Home | Main Index | Thread Index | Old Index