Accept resize request only from the client which connected first

The problem this prevents is that when two instances are viewing
simultaneously they won't resize each other windows.
This commit is contained in:
Marc André Tanner 2014-02-27 17:04:36 +01:00
parent ed4f1ecdcd
commit 12287e473d
1 changed files with 2 additions and 1 deletions

View File

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