NetBSD Problem Report #53617

From www@NetBSD.org  Tue Sep 18 22:12:53 2018
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 F2BEF7A18A
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 18 Sep 2018 22:12:52 +0000 (UTC)
Message-Id: <20180918221236.EBCED7A212@mollari.NetBSD.org>
Date: Tue, 18 Sep 2018 22:12:36 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: getch(3) does not cause implicit refresh(3) on stdscr
X-Send-Pr-Version: www-1.0

>Number:         53617
>Category:       lib
>Synopsis:       getch(3) does not cause implicit refresh(3) on stdscr
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 18 22:15:00 +0000 2018
>Closed-Date:    Thu Sep 27 15:12:43 +0000 2018
>Last-Modified:  Mon May 20 22:20:01 +0000 2019
>Originator:     Kamil Rytarowski
>Release:        NetBSD 8.99.24 amd64
>Organization:
TNF
>Environment:
NetBSD rugged 8.99.24 NetBSD 8.99.24 (GENERIC) #8: Fri Aug 31 21:55:37 CEST 2018  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
Calling getch() will cause an
implicit refresh() on stdscr.

-- getch(3)

When I move a cursor with move(3) to a new position, it's position is not updated on getch(3).

This works well with ncurses.
>How-To-Repeat:
#include <curses.h>
int
main(int argc, char **argv)
{

	initscr();
	move(10,10);
	getch();
	endwin();

	return 0;
}

>Fix:
N/A

There is a workaround to explicitly call refresh(3) that makes it work.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->pending-pullups
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Wed, 26 Sep 2018 20:57:36 +0200
State-Changed-Why:
[pullup-8 #1040] Start touching the window with move(3) in curses(3)
Fixed in HEAD in src/lib/libcurses/move.c r.1.19


State-Changed-From-To: pending-pullups->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Thu, 27 Sep 2018 17:12:43 +0200
State-Changed-Why:
pullup-8 #1040 done

lib/libcurses/move.c                            1.19


From: "Brett Lymn" <blymn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53617 CVS commit: src/lib/libcurses
Date: Mon, 20 May 2019 22:17:42 +0000

 Module Name:	src
 Committed By:	blymn
 Date:		Mon May 20 22:17:41 UTC 2019

 Modified Files:
 	src/lib/libcurses: add_wch.c add_wchstr.c addbytes.c addch.c
 	    addchnstr.c addnstr.c addwstr.c copywin.c cr_put.c curses_private.h
 	    delch.c erase.c fileio.h get_wch.c get_wstr.c getch.c getstr.c
 	    in_wch.c in_wchstr.c inch.c inchstr.c ins_wch.c ins_wstr.c insch.c
 	    insstr.c instr.c inwstr.c line.c move.c newwin.c printw.c putchar.c
 	    refresh.c scroll.c

 Log Message:
 Back out incorrect fix for PR 53617 and fix it in a different way.
 Keep track of the cursor location, if getch is called without a refresh
 and without pending updates (dirty windows) then move the cursor to the
 correct location directly.  Doing this prevents unnecessary refreshes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/add_wch.c
 cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/add_wchstr.c \
     src/lib/libcurses/addchnstr.c src/lib/libcurses/get_wstr.c \
     src/lib/libcurses/in_wchstr.c src/lib/libcurses/inwstr.c
 cvs rdiff -u -r1.50 -r1.51 src/lib/libcurses/addbytes.c
 cvs rdiff -u -r1.19 -r1.20 src/lib/libcurses/addch.c src/lib/libcurses/move.c
 cvs rdiff -u -r1.15 -r1.16 src/lib/libcurses/addnstr.c
 cvs rdiff -u -r1.4 -r1.5 src/lib/libcurses/addwstr.c
 cvs rdiff -u -r1.17 -r1.18 src/lib/libcurses/copywin.c
 cvs rdiff -u -r1.33 -r1.34 src/lib/libcurses/cr_put.c
 cvs rdiff -u -r1.69 -r1.70 src/lib/libcurses/curses_private.h
 cvs rdiff -u -r1.24 -r1.25 src/lib/libcurses/delch.c \
     src/lib/libcurses/scroll.c
 cvs rdiff -u -r1.26 -r1.27 src/lib/libcurses/erase.c
 cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/fileio.h \
     src/lib/libcurses/in_wch.c src/lib/libcurses/insstr.c \
     src/lib/libcurses/instr.c
 cvs rdiff -u -r1.21 -r1.22 src/lib/libcurses/get_wch.c
 cvs rdiff -u -r1.71 -r1.72 src/lib/libcurses/getch.c
 cvs rdiff -u -r1.25 -r1.26 src/lib/libcurses/getstr.c
 cvs rdiff -u -r1.12 -r1.13 src/lib/libcurses/inch.c \
     src/lib/libcurses/ins_wch.c src/lib/libcurses/ins_wstr.c
 cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/inchstr.c
 cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/insch.c
 cvs rdiff -u -r1.9 -r1.10 src/lib/libcurses/line.c
 cvs rdiff -u -r1.55 -r1.56 src/lib/libcurses/newwin.c
 cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/printw.c
 cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/putchar.c
 cvs rdiff -u -r1.109 -r1.110 src/lib/libcurses/refresh.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.