diff options
author | Zed Lopez <zed.lopez@gmail.com> | 2010-05-18 09:06:26 -0700 |
---|---|---|
committer | Shawn Betts <sabetts@Woaaahdudelike.local> | 2010-05-18 11:29:09 -0700 |
commit | c48f75e86aea05a8b09a9e52eebe202ac2e84c3c (patch) | |
tree | d8b132368e81287193d41f764754d6c921b5c1f2 /src | |
parent | 7ca1af7c055d435888f1c5e3dd02f1456334c599 (diff) | |
download | ratpoison-c48f75e86aea05a8b09a9e52eebe202ac2e84c3c.zip |
add a titlechanged hook
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.c | 1 | ||||
-rw-r--r-- | src/events.c | 4 | ||||
-rw-r--r-- | src/globals.c | 2 | ||||
-rw-r--r-- | src/globals.h | 1 |
4 files changed, 7 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c index dabb8e5..b3baadb 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1407,6 +1407,7 @@ cmd_rename (int interactive UNUSED, struct cmdarg **args) free (current_window()->user_name); current_window()->user_name = xstrdup (ARG_STRING(0)); current_window()->named = 1; + hook_run (&rp_title_changed_hook); /* Update the program bar. */ update_window_names (current_screen(), defaults.window_fmt); diff --git a/src/events.c b/src/events.c index d973639..6a229b8 100644 --- a/src/events.c +++ b/src/events.c @@ -624,8 +624,10 @@ property_notify (XEvent *ev) { case XA_WM_NAME: PRINT_DEBUG (("updating window name\n")); - if (update_window_name (win)) + if (update_window_name (win)) { update_window_names (win->scr, defaults.window_fmt); + hook_run (&rp_title_changed_hook); + } break; case XA_WM_NORMAL_HINTS: diff --git a/src/globals.c b/src/globals.c index eb94db6..3029aef 100644 --- a/src/globals.c +++ b/src/globals.c @@ -232,6 +232,7 @@ LIST_HEAD (rp_quit_hook); LIST_HEAD (rp_restart_hook); LIST_HEAD (rp_delete_window_hook); LIST_HEAD (rp_new_window_hook); +LIST_HEAD (rp_title_changed_hook); struct rp_hook_db_entry rp_hook_db[]= {{"key", &rp_key_hook}, @@ -243,6 +244,7 @@ struct rp_hook_db_entry rp_hook_db[]= {"quit", &rp_quit_hook}, {"restart", &rp_restart_hook}, {"newwindow", &rp_new_window_hook}, + {"titlechanged", &rp_title_changed_hook}, {NULL, NULL}}; void diff --git a/src/globals.h b/src/globals.h index aa73451..e5ba32a 100644 --- a/src/globals.h +++ b/src/globals.h @@ -182,6 +182,7 @@ extern struct list_head rp_delete_window_hook; extern struct list_head rp_quit_hook; extern struct list_head rp_restart_hook; extern struct list_head rp_new_window_hook; +extern struct list_head rp_title_changed_hook; extern struct rp_hook_db_entry rp_hook_db[]; |