]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
gui: Speed up window refresh.
authorAndre Noll <maan@systemlinux.org>
Mon, 6 Jan 2014 20:12:38 +0000 (20:12 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 4 May 2014 13:48:55 +0000 (15:48 +0200)
We had way too many calls to wrefresh() which copies the named
window to the physical terminal screen. This slows down the display
considerably, especially on slow machines.

It is more efficient to perform the copy only once per scheduler
iteration. So this commit adds a flag "needs_update" to struct
gui_window, and all callers to wrefresh() are changed to call
refresh_window() instead. This new function is much cheaper since it
only turns on the needs_update flag but does nothing else.

In input_post_select() we check which windows have the flag set and
repaint those windows using wnoutrefresh() and then doupdate(). This
two-step approach is described in the curs_refresh(3X) man page as
more efficient then calling wrefresh() for each window separately
since it avoids alternating calls to wnoutrefresh() and doupdate().


No differences found