diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-02-09 18:08:01 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-02-09 18:08:01 +0000 |
commit | c9cfc9a9f356386e07e6273f91dd3d46ca076c12 (patch) | |
tree | fd4f75d10b6b32715b6626e0af2c175d3b603401 /names.c | |
parent | 9d90d9ad705b9059e9bfa61b86cca7744cbca53d (diff) | |
download | rtmux-c9cfc9a9f356386e07e6273f91dd3d46ca076c12.tar.gz rtmux-c9cfc9a9f356386e07e6273f91dd3d46ca076c12.tar.bz2 rtmux-c9cfc9a9f356386e07e6273f91dd3d46ca076c12.zip |
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 :-/.
Diffstat (limited to 'names.c')
-rw-r--r-- | names.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 { |