diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-20 18:03:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-09-20 18:03:23 +0000 |
commit | 34f87e521bef898ffb3687933cb169b173a35fad (patch) | |
tree | 227bbe2a209833ff77cae4f39f33ce0ae44ffa61 /server.c | |
parent | 2cd99f0ebbd234c76754bbeee554834cb8cb62ba (diff) | |
download | rtmux-34f87e521bef898ffb3687933cb169b173a35fad.tar.gz rtmux-34f87e521bef898ffb3687933cb169b173a35fad.tar.bz2 rtmux-34f87e521bef898ffb3687933cb169b173a35fad.zip |
Last window option.
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.8 2007-08-27 20:36:52 nicm Exp $ */ +/* $Id: server.c,v 1.9 2007-09-20 18:03:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -75,6 +75,7 @@ void process_refresh_msg(struct client *, struct hdr *); void process_sessions_msg(struct client *, struct hdr *); void process_windows_msg(struct client *, struct hdr *); void process_rename_msg(struct client *, struct hdr *); +void process_last_msg(struct client *, struct hdr *); void rename_callback(struct client *, const char *); /* Fork and start server process. */ @@ -768,6 +769,9 @@ process_client(struct client *c) case MSG_RENAME: process_rename_msg(c, &hdr); break; + case MSG_LAST: + process_last_msg(c, &hdr); + break; default: fatalx("unexpected message"); } @@ -1061,6 +1065,21 @@ process_rename_msg(struct client *c, struct hdr *hdr) c->session->window->name, MAXNAMELEN, rename_callback); } +/* Last window message from client */ +void +process_last_msg(struct client *c, struct hdr *hdr) +{ + if (c->session == NULL) + return; + if (hdr->size != 0) + fatalx("bad MSG_LAST size"); + + if (session_last(c->session) == 0) + changed_window(c); + else + write_message(c, "No last window"); +} + /* Callback for rename. */ void rename_callback(struct client *c, const char *string) |