From fdd42223cfc6751e4c632daef64189dbcfc2abe8 Mon Sep 17 00:00:00 2001 From: Eric A Date: Mon, 12 Apr 2010 10:37:03 -0700 Subject: add a new_window_hook to the map_window function of manage.c. --- doc/ratpoison.1 | 2 ++ src/globals.c | 2 ++ src/globals.h | 1 + src/manage.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/doc/ratpoison.1 b/doc/ratpoison.1 index a453414..8d9924e 100644 --- a/doc/ratpoison.1 +++ b/doc/ratpoison.1 @@ -204,6 +204,8 @@ Possible events are: .br \fBdeletewindow\fP Run after a window is withdrawn. .br +\fBnewwindow\fP Run after a new window is mapped. +.br \fBkey\fP Run whenever a top level key is pressed. (by default \fBC\-t\fP) .br diff --git a/src/globals.c b/src/globals.c index 9ebc8e3..eb94db6 100644 --- a/src/globals.c +++ b/src/globals.c @@ -231,6 +231,7 @@ LIST_HEAD (rp_switch_screen_hook); LIST_HEAD (rp_quit_hook); LIST_HEAD (rp_restart_hook); LIST_HEAD (rp_delete_window_hook); +LIST_HEAD (rp_new_window_hook); struct rp_hook_db_entry rp_hook_db[]= {{"key", &rp_key_hook}, @@ -241,6 +242,7 @@ struct rp_hook_db_entry rp_hook_db[]= {"deletewindow", &rp_delete_window_hook}, {"quit", &rp_quit_hook}, {"restart", &rp_restart_hook}, + {"newwindow", &rp_new_window_hook}, {NULL, NULL}}; void diff --git a/src/globals.h b/src/globals.h index 00af94d..aa73451 100644 --- a/src/globals.h +++ b/src/globals.h @@ -181,6 +181,7 @@ extern struct list_head rp_switch_screen_hook; 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 rp_hook_db_entry rp_hook_db[]; diff --git a/src/manage.c b/src/manage.c index 8aaec31..f822c53 100644 --- a/src/manage.c +++ b/src/manage.c @@ -815,6 +815,8 @@ map_window (rp_window *win) set_active_window (win); else show_rudeness_msg (win, 0); + + hook_run (&rp_new_window_hook); } void -- cgit v1.2.3