NetBSD-Bugs archive

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

lib/55579: [libcurses] inconsistent behaviour of subwindows



>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@localhost:/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:



Home | Main Index | Thread Index | Old Index