diff options
author | sabetts <sabetts> | 2006-09-26 23:44:36 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2006-09-26 23:44:36 +0000 |
commit | ad859c2d9b0f19ff55ea016d23a97853ef99b89e (patch) | |
tree | fdd75d9d29e23a21ba6b44cc0af1af257ad234e6 /src/manage.c | |
parent | 7977c0c3508e1437f50a900d827e9259f0b962bf (diff) | |
download | ratpoison-ad859c2d9b0f19ff55ea016d23a97853ef99b89e.zip |
* src/manage.c (update_window_name): return 1 if anything changed. 0 otherwise.
* src/events.c (property_notify): only update the window names if
the window name actually changed.
* src/bar.h (redraw_last_message): new prototype
* src/bar.c (update_bar): update the window list if that's what's
displayed. call redraw_last_message.
(update_window_names): call marked_message_internal.
(marked_message): call marked_message_internal.
(marked_message_internal): ripped body from old marked_message
minus alarm reset.
(redraw_last_message): new function
(show_last_message): call redraw_last_message
* src/actions.c: include ctype.h
(cmd_license): use redraw_last_message
(cmd_help): likewise
Diffstat (limited to 'src/manage.c')
-rw-r--r-- | src/manage.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/manage.c b/src/manage.c index 9e9ba2f..50743b4 100644 --- a/src/manage.c +++ b/src/manage.c @@ -300,15 +300,18 @@ get_res_class (Window w) return name; } -/* Reget the WM_NAME property for the window and update its name. */ +/* Reget the WM_NAME property for the window and update its + name. Return 1 if the name changed. */ int update_window_name (rp_window *win) { char *newstr; + int changed = 0; newstr = get_wmname (win->w); if (newstr != NULL) { + changed = changed || win->wm_name == NULL || strcmp (newstr, win->wm_name); free (win->wm_name); win->wm_name = newstr; } @@ -316,6 +319,7 @@ update_window_name (rp_window *win) newstr = get_res_class (win->w); if (newstr != NULL) { + changed = changed || win->res_class == NULL || strcmp (newstr, win->res_class); free (win->res_class); win->res_class = newstr; } @@ -323,11 +327,12 @@ update_window_name (rp_window *win) newstr = get_res_name (win->w); if (newstr != NULL) { + changed = changed || win->res_name == NULL || strcmp (newstr, win->res_name); free (win->res_name); win->res_name = newstr; } - return 1; + return changed; } /* Send an artificial configure event to the window. */ |