From c9cfc9a9f356386e07e6273f91dd3d46ca076c12 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 9 Feb 2009 18:08:01 +0000 Subject: 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 :-/. --- names.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'names.c') diff --git a/names.c b/names.c index 4e6eba63..1d83e8d2 100644 --- a/names.c +++ b/names.c @@ -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 @@ -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 { -- cgit