Remove MSG_REDRAW it was actually never sent by the client

This commit is contained in:
Marc André Tanner 2018-03-17 18:38:50 +01:00
parent 17b386e93f
commit bb7e4e77f4
3 changed files with 2 additions and 5 deletions

View File

@ -67,8 +67,7 @@ enum PacketType {
MSG_ATTACH = 1, MSG_ATTACH = 1,
MSG_DETACH = 2, MSG_DETACH = 2,
MSG_RESIZE = 3, MSG_RESIZE = 3,
MSG_REDRAW = 4, MSG_EXIT = 4,
MSG_EXIT = 5,
}; };
typedef struct { typedef struct {

View File

@ -16,7 +16,6 @@ static void print_packet(const char *prefix, Packet *pkt) {
[MSG_ATTACH] = "ATTACH", [MSG_ATTACH] = "ATTACH",
[MSG_DETACH] = "DETACH", [MSG_DETACH] = "DETACH",
[MSG_RESIZE] = "RESIZE", [MSG_RESIZE] = "RESIZE",
[MSG_REDRAW] = "REDRAW",
[MSG_EXIT] = "EXIT", [MSG_EXIT] = "EXIT",
}; };
const char *type = "UNKNOWN"; const char *type = "UNKNOWN";

View File

@ -221,8 +221,7 @@ static void server_mainloop(void) {
break; break;
case MSG_RESIZE: case MSG_RESIZE:
c->state = STATE_ATTACHED; c->state = STATE_ATTACHED;
case MSG_REDRAW: if (!(c->flags & CLIENT_READONLY) && c == server.clients) {
if (!(c->flags & CLIENT_READONLY) && (client_packet.type == MSG_REDRAW || c == server.clients)) {
debug("server-ioct: TIOCSWINSZ\n"); debug("server-ioct: TIOCSWINSZ\n");
struct winsize ws = { 0 }; struct winsize ws = { 0 };
ws.ws_row = client_packet.u.ws.rows; ws.ws_row = client_packet.u.ws.rows;