Skip to content

wayland: Bump default max buffer size to 1 MiB

Vlad Zahorodnii requested to merge work/cherry-pick-7590c6d3 into Plasma/6.1

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.

(cherry picked from commit 7590c6d3)

Co-authored-by: Vlad Zahorodnii vlad.zahorodnii@kde.org


Why is it worthwhile backporting to 6.1? It's going to address the issue where some applications are accidentally killed due to input events coming in too fast.

Is it safe? "It should be"

Merge request reports