Alternative subscription model?
A different more flexible and more easily extensible way to subscribe to events could be done using a different subscription model.
For example, a subscribe request could specify the windows (represented by XID or -1 to represent selected client) and the specific properties of the client to subscribe to. Then, the client would receive event messages only when those properties change on the subscribed windows. If the client were to be exited, an event message with the window_id changing to 0 could indicate the client is closed.
A similar subscription request could be made for monitors where the monitor index could be specified (or -1 to represent selected monitor) and then the properties to listen for.
This model would require extra data to be held per socket client (maybe as subscription packets/structs) that specify each client's specific subscriptions. This model would be very flexible and make it easy to add properties to. It would most likely cover most major properties that a client would want to subscribe to.
This would minimize the amount of data being transmitted and the amount of data being processed on the client end since the clients would receive only the information they need and nothing more. However, depending on the implementation, this could increase the processing required on dwm (could decrease responsiveness).
If processing can be minimized on dwm's end, this could be the most effective subscription model, but will require a decent amount of additional code.