NetBSD Problem Report #55579

From www@netbsd.org  Sun Aug 16 19:47:17 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B431B1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 Aug 2020 19:47:17 +0000 (UTC)
Message-Id: <20200816194716.E23EC1A9246@mollari.NetBSD.org>
Date: Sun, 16 Aug 2020 19:47:16 +0000 (UTC)
From: jnaman806@gmail.com
Reply-To: jnaman806@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [libcurses] inconsistent behaviour of subwindows
X-Send-Pr-Version: www-1.0

>Number:         55579
>Category:       lib
>Synopsis:       [libcurses] inconsistent behaviour of subwindows
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 16 19:50:00 +0000 2020
>Originator:     Naman Jain
>Release:        NetBSD 9.0
>Organization:
IIT Kanpur
>Environment:
NetBSD localhost 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
orig <- newwin()
sub <- subwin(orig)

If we make changes to a subwindow(say add string) and do not call wrefresh(sub), the changes should not be reflected when we call wrefresh(orig).

The curses is showing strange behavior, consider a hierarchy of 3 windows; win1, win2, win3 in order. Adding a string in win2, win3 and then refreshing win1 must not reflect changes. These changes can be made possible if sycnok on win2/win3. 
Current behaviour is: changes made to win2 are reflected and those made to win3 are not.
>How-To-Repeat:
#include <curses.h>
#include <locale.h>

int main() {
    setlocale(LC_ALL, "");
    initscr();

    WINDOW *win1 = newwin(6,6,2,5);
    WINDOW *win2 = subwin(win1, 5, 5, 3, 6);
    WINDOW *win3 = subwin(win2, 4, 4, 4, 7);

    waddstr(win2, "aaa");
    waddstr(win3, "bbb");
    wrefresh(win1);

    getch();
    endwin();
    return 0;
}

>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.