Draft: RFC: wayland: Bump default max buffer size to 1 MiB
This is to prevent disconnecting clients that sometimes struggle with keeping up with the events that the compositor sends. 1 MiB was eyeballed.
Wayland's wire protocol consists of a stream of messages. Every message consists of a header (2 words: 1 word for object id, the other word specifies the message size + event/request opcode) and the arguments.
Considering the compositor sending motion events generated by a mouse with 1000Hz polling rate, we have
- wl_pointer.motion event size: (4 bytes for serial + 4 bytes for x + 4 bytes for y + 8 bytes for header) = 20 bytes
- wl_pointer.frame event size: 8 bytes for header
So in total, if the client freezes for a second, the client buffer size should be at least (20 + 8) * 1000 / 1024 = 27 KiB.