=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/server-msg.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/tmux/Attic/server-msg.c 2009/09/23 06:05:02 1.18 --- src/usr.bin/tmux/Attic/server-msg.c 2009/09/23 06:12:58 1.19 *************** *** 1,4 **** ! /* $OpenBSD: server-msg.c,v 1.18 2009/09/23 06:05:02 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-msg.c,v 1.19 2009/09/23 06:12:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 17,22 **** --- 17,23 ---- */ #include + #include #include #include *************** *** 28,34 **** void server_msg_command(struct client *, struct msg_command_data *); void server_msg_identify(struct client *, struct msg_identify_data *, int); - void server_msg_resize(struct client *, struct msg_resize_data *); void printflike2 server_msg_command_error(struct cmd_ctx *, const char *, ...); void printflike2 server_msg_command_print(struct cmd_ctx *, const char *, ...); --- 29,34 ---- *************** *** 40,46 **** struct imsg imsg; struct msg_command_data commanddata; struct msg_identify_data identifydata; - struct msg_resize_data resizedata; struct msg_unlock_data unlockdata; struct msg_environ_data environdata; ssize_t n, datalen; --- 40,45 ---- *************** *** 81,91 **** server_msg_identify(c, &identifydata, imsg.fd); break; case MSG_RESIZE: ! if (datalen != sizeof resizedata) fatalx("bad MSG_RESIZE size"); - memcpy(&resizedata, imsg.data, sizeof resizedata); ! server_msg_resize(c, &resizedata); break; case MSG_EXITING: if (datalen != 0) --- 80,91 ---- server_msg_identify(c, &identifydata, imsg.fd); break; case MSG_RESIZE: ! if (datalen != 0) fatalx("bad MSG_RESIZE size"); ! tty_resize(&c->tty); ! recalculate_sizes(); ! server_redraw_client(c); break; case MSG_EXITING: if (datalen != 0) *************** *** 261,293 **** if (data->flags & IDENTIFY_HASDEFAULTS) c->tty.term_flags |= TERM_HASDEFAULTS; ! c->tty.sx = data->sx; ! if (c->tty.sx == 0) ! c->tty.sx = 80; ! c->tty.sy = data->sy; ! if (c->tty.sy == 0) ! c->tty.sy = 24; c->flags |= CLIENT_TERMINAL; - } - - void - server_msg_resize(struct client *c, struct msg_resize_data *data) - { - c->tty.sx = data->sx; - if (c->tty.sx == 0) - c->tty.sx = 80; - c->tty.sy = data->sy; - if (c->tty.sy == 0) - c->tty.sy = 24; - - c->tty.cx = UINT_MAX; - c->tty.cy = UINT_MAX; - c->tty.rupper = UINT_MAX; - c->tty.rlower = UINT_MAX; - - recalculate_sizes(); - - /* Always redraw this client. */ - server_redraw_client(c); } --- 261,267 ---- if (data->flags & IDENTIFY_HASDEFAULTS) c->tty.term_flags |= TERM_HASDEFAULTS; ! tty_resize(&c->tty); c->flags |= CLIENT_TERMINAL; }