Don't try to change the window name unless the pid of the process chosen has

changed. Reduces CPU use.

osdep-* stuff is a bit horrible now but there we go :-/.
This commit is contained in:
Nicholas Marriott
2009-02-09 18:08:01 +00:00
parent 9d90d9ad70
commit c9cfc9a9f3
7 changed files with 83 additions and 54 deletions

11
names.c
View File

@ -1,4 +1,4 @@
/* $Id: names.c,v 1.2 2009-01-26 22:57:19 nicm Exp $ */
/* $Id: names.c,v 1.3 2009-02-09 18:08:01 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -53,14 +53,19 @@ set_window_names(void)
if (w->active->screen != &w->active->base)
name = NULL;
else
name = get_argv0(w->active->fd, w->active->tty);
else {
if (osdep_get_name(w->active->fd,
w->active->tty, &w->name_pid, &name) == 1)
continue;
}
if (name == NULL)
wname = default_window_name(w);
else {
wname = parse_window_name(name);
xfree(name);
}
if (strcmp(wname, w->name) == 0)
xfree(wname);
else {