Skip to content

wayland: Bump default max buffer size to 1 MiB

Vlad Zahorodnii requested to merge work/zzag/default-max-buffer-size into master

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. 1 MiB corresponds to the client not processing the motion events for approximately 30 seconds.

Edited by Vlad Zahorodnii

Merge request reports