Change resize policy

Only resize if the request is from the least recently connected client
or explicitly requested via a command.
This commit is contained in:
Marc André Tanner 2014-03-06 18:55:44 +01:00
parent 5dbe797f0c
commit 95db782096
1 changed files with 2 additions and 2 deletions

View File

@ -277,9 +277,9 @@ static void server_mainloop() {
case MSG_ATTACH:
case MSG_RESIZE:
c->state = STATE_ATTACHED;
if (!c->next) /* only update size if this is first connected client */
ioctl(server.pty, TIOCSWINSZ, &c->input.pkt.u.ws);
case MSG_REDRAW:
if (c->input.pkt.type == MSG_REDRAW || c == server.clients)
ioctl(server.pty, TIOCSWINSZ, &c->input.pkt.u.ws);
kill(-server.pid, SIGWINCH);
break;
case MSG_DETACH: