module/i3: subscribe *before* requesting initial workspace list

This ensures we don't have a race, where we might miss workspace
changes between the initial list and subscribing.
This commit is contained in:
Daniel Eklöf 2019-02-09 13:14:08 +01:00
parent be4765fadd
commit 83db675e01

View file

@ -575,8 +575,8 @@ run(struct module *mod)
}
send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_VERSION, NULL);
send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
send_pkg(sock, I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[\"workspace\", \"window\"]");
send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
/* Initial reply typically requires a couple of KB. But we often
* need more later. For example, switching workspaces can result