summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2015-12-08 01:10:31 +0000
committernicm <nicm>2015-12-08 01:10:31 +0000
commitd2fb0efcd197bf0d581a0f7b1e27223d095cb339 (patch)
tree3de4e6a7451d355ff752da7ec6013ea57c95b54c /server-client.c
parentdbfce2a4d8ea0bd4773eacf154fd3e3406d1be5e (diff)
Add hooks infrastructure, basic commands (set-hook, show-hooks) and a
couple of not very useful client hooks. This will eventually let commands be run at various points and on notifications. Joint work with Thomas Adam.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/server-client.c b/server-client.c
index d2abd356..c948e980 100644
--- a/server-client.c
+++ b/server-client.c
@@ -256,6 +256,19 @@ server_client_free(__unused int fd, __unused short events, void *arg)
free(c);
}
+/* Detach a client. */
+void
+server_client_detach(struct client *c, enum msgtype msgtype)
+{
+ struct session *s = c->session;
+
+ if (s == NULL)
+ return;
+
+ hooks_run(c->session->hooks, "client-detached", c);
+ proc_send_s(c->peer, msgtype, s->name);
+}
+
/* Check for mouse keys. */
key_code
server_client_check_mouse(struct client *c)
@@ -995,6 +1008,8 @@ server_client_dispatch(struct imsg *imsg, void *arg)
recalculate_sizes();
server_redraw_client(c);
}
+ if (c->session != NULL)
+ hooks_run(c->session->hooks, "client-resized", c);
break;
case MSG_EXITING:
if (datalen != 0)