summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-10-15 22:26:19 +0000
committersabetts <sabetts>2003-10-15 22:26:19 +0000
commit0064759b73fd747eda2b28d5d89ab7d5c3cacba9 (patch)
tree31c46c07f0cd495e02958c5693001c5cd70398ff
parentf6780b3be38416b4a533de850f546c6f8aa8c5b8 (diff)
downloadratpoison-0064759b73fd747eda2b28d5d89ab7d5c3cacba9.zip
* src/globals.c (rp_hook_db): add hooks quit and restart
(rp_quit_hook): new global (rp_restart_hook): likewise * src/events.c (handle_signals): call the restart and quit hooks
-rw-r--r--ChangeLog16
-rw-r--r--doc/ratpoison.texi4
-rw-r--r--src/events.c3
-rw-r--r--src/globals.c4
-rw-r--r--src/globals.h2
5 files changed, 29 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 733dfd3..1313f01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2003-10-15 Shawn Betts <sabetts@vcn.bc.ca>
+
+ * src/globals.c (rp_hook_db): add hooks quit and restart
+ (rp_quit_hook): new global
+ (rp_restart_hook): likewise
+
+ * src/events.c (handle_signals): call the restart and quit hooks
+
+2003-09-24 Shawn Betts <sabetts@vcn.bc.ca>
+
+ * contrib/clickframe.pl: put the patch at the end of the file and
+ make it runnable through patch.
+
+ * contrib/Makefile.am (EXTRA_DIST): add clickframe.pl
+ (pkgdata_DATA): likewise
+
2003-09-21 Shawn Betts <sabetts@vcn.bc.ca>
* src/bar.c (prepare_bar): move and resize the window before mapping it.
diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi
index cc29633..e47d6e0 100644
--- a/doc/ratpoison.texi
+++ b/doc/ratpoison.texi
@@ -486,6 +486,10 @@ Run when the user switches to another frame. This is also run when the
user switches to a different screen, since a frame switch also occurs.
@item switchgroup
Run when the user switches to a different group.
+@item quit
+Run when ratpoison exits.
+@item restart
+Run when ratpoison restarts.
@end table
@end deffn
diff --git a/src/events.c b/src/events.c
index 6a6d868..85548a4 100644
--- a/src/events.c
+++ b/src/events.c
@@ -775,6 +775,8 @@ handle_signals ()
if (hup_signalled > 0)
{
+ PRINT_DEBUG (("Restarting\n"));
+ hook_run (&rp_restart_hook);
clean_up ();
execvp(myargv[0], myargv);
}
@@ -782,6 +784,7 @@ handle_signals ()
if (kill_signalled > 0)
{
PRINT_DEBUG (("Exiting\n"));
+ hook_run (&rp_quit_hook);
clean_up ();
exit (EXIT_SUCCESS);
}
diff --git a/src/globals.c b/src/globals.c
index 6284a66..8fbe737 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -73,12 +73,16 @@ LIST_HEAD (rp_prefix_hook);
LIST_HEAD (rp_switch_win_hook);
LIST_HEAD (rp_switch_frame_hook);
LIST_HEAD (rp_switch_group_hook);
+LIST_HEAD (rp_quit_hook);
+LIST_HEAD (rp_restart_hook);
struct rp_hook_db_entry rp_hook_db[]=
{{"prefix", &rp_prefix_hook},
{"switchwin", &rp_switch_win_hook},
{"switchframe", &rp_switch_frame_hook},
{"switchgroup", &rp_switch_group_hook},
+ {"quit", &rp_quit_hook},
+ {"restart", &rp_restart_hook},
{NULL, NULL}};
void
diff --git a/src/globals.h b/src/globals.h
index c2166b1..2e5ac29 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -133,6 +133,8 @@ extern struct list_head rp_prefix_hook;
extern struct list_head rp_switch_win_hook;
extern struct list_head rp_switch_frame_hook;
extern struct list_head rp_switch_group_hook;
+extern struct list_head rp_quit_hook;
+extern struct list_head rp_restart_hook;
extern struct rp_hook_db_entry rp_hook_db[];