]> git.tuebingen.mpg.de Git - paraslash.git/commit
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)
commit9cf149617f6de5a4a16f5f2af39bd532310246dc
tree73f25a29b2da82022748ff845f9644251ab1291f
parent96fbecf492a660afbe7cbd5d45ae1dbe02f3acbf
gui: Speed up window refresh.

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().
gui.c