NetBSD-Bugs archive

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

Re: lib/41223: libcurses: curs_set and move do not cause refresh on getch



The following reply was made to PR lib/41223; it has been noted by GNATS.

From: Jed Davis <jld%panix.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: lib/41223: libcurses: curs_set and move do not cause refresh
        on getch
Date: Thu, 7 May 2009 22:18:39 -0400

 On Tue, Apr 21, 2009 at 12:45:02PM +0000, Brett Lymn wrote:
 >  I do not think this is the correct thing to do.  It is unacceptable to
 >  force a refresh of the window for every character as this may mean, in
 >  some very dumb terminal cases, a redraw of the screen.
 
 Oh; I'd assumed that libcurses would be able to avoid unnecessary
 redrawing even on dumber terminals.  
 
 I'd also assumed that most getch()es would require a refresh anyway, but
 now that I've done a bit of testing with an instrumented libcurses I see
 that this isn't necessarily so.
 
 >  A peek at the Open Solaris curses code shows they perform a fflush on
 >  the output file descriptor after the tput - I think that would be a
 >  better solution.
 
 The other thing that OpenSolaris curses does is for wmove to set a bit
 in the per-WINDOW flags field, which causes a refresh on the next getch.
 ( 
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libcurses/screen/wmove.c#72
 )
 ( 
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libcurses/screen/wgetch.c#84
 )
 
 In the application where I noticed this issue, just making curs_set do
 the fflush and not also taking care of the wmove causes the cursor to be
 visible and in the wrong place.
 
 --Jed
 


Home | Main Index | Thread Index | Old Index