summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric A <eric225125@gmail.com>2010-04-12 10:37:03 -0700
committerShawn Betts <sabetts@Woaaahdudelike.local>2010-04-12 10:37:03 -0700
commitfdd42223cfc6751e4c632daef64189dbcfc2abe8 (patch)
tree61d0607f419c3d6aef1f4189fcd04724197eeffc
parent526b74d89dfad6772d15004228ff617898918daf (diff)
downloadratpoison-fdd42223cfc6751e4c632daef64189dbcfc2abe8.zip
add a new_window_hook to the map_window function of manage.c.
-rw-r--r--doc/ratpoison.12
-rw-r--r--src/globals.c2
-rw-r--r--src/globals.h1
-rw-r--r--src/manage.c2
4 files changed, 7 insertions, 0 deletions
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