dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 55629a1ff99f4b475ad66108b9599185929257d8
parent 97b4a38b53cc4e9d31d0cfebb8796a8e3e7960e2
Author: Mark Edgar <medgar123@gmail.com>
Date:   Tue,  8 Oct 2013 23:58:06 +0200

Call doupdate() immediately before select() to reduce screen updates and terminal output.

Diffstat:
dvtm.c | 18+++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -251,7 +251,7 @@ drawbar() { attrset(NORMAL_ATTR); if (sel) curs_set(vt_cursor(sel->term)); - refresh(); + wnoutrefresh(stdscr); } static void @@ -295,7 +295,7 @@ static void draw(Client *c) { draw_content(c); draw_border(c); - wrefresh(c->window); + wnoutrefresh(c->window); } static void @@ -315,12 +315,11 @@ draw_all(bool border) { * this has the effect that the cursor position is * accurate */ - refresh(); if (sel) { draw_content(sel); if (border) draw_border(sel); - wrefresh(sel->window); + wnoutrefresh(sel->window); } } @@ -395,12 +394,12 @@ focus(Client *c) { settitle(c); if (tmp) { draw_border(tmp); - wrefresh(tmp->window); + wnoutrefresh(tmp->window); } if (isarrange(fullscreen)) redrawwin(c->window); draw_border(c); - wrefresh(c->window); + wnoutrefresh(c->window); } static void @@ -568,8 +567,6 @@ resize_screen() { resizeterm(screen.h, screen.w); wresize(stdscr, screen.h, screen.w); - wrefresh(curscr); - refresh(); waw = screen.w; wah = screen.h; @@ -676,7 +673,7 @@ destroy(Client *c) { sel = NULL; } werase(c->window); - wrefresh(c->window); + wnoutrefresh(c->window); vt_destroy(c->term); delwin(c->window); if (!clients && countof(actions)) { @@ -912,7 +909,6 @@ static void redraw(const char *args[]) { for (Client *c = clients; c; c = c->next) vt_dirty(c->term); - wrefresh(curscr); resize_screen(); draw_all(true); } @@ -1378,6 +1374,7 @@ main(int argc, char *argv[]) { nfds = max(nfds, c->pty); c = c->next; } + doupdate(); r = select(nfds + 1, &rd, NULL, NULL, NULL); if (r == -1 && errno == EINTR) @@ -1444,7 +1441,6 @@ main(int argc, char *argv[]) { draw_content(sel); wnoutrefresh(sel->window); } - doupdate(); } cleanup();