Keysym event in the text protocol

Pekka Paalanen ppaalanen at gmail.com
Mon Jul 28 22:50:18 PDT 2014


On Mon, 28 Jul 2014 16:40:31 -0700
Bill Spitzak <spitzak at gmail.com> wrote:

> On 07/28/2014 02:49 PM, Jasper St. Pierre wrote:
> 
> > Try looking at the code next time. It creates a temporary file, unlinks
> > the file, writes the XKB description to it using xkb_map_get_as_string,
> > and sends it over.
> 
> Okay I think I see this now. I'm not sure why there is a cutoff between 
> sizes sent over the protocol and ones that are out-of-band like this, 
> xkb data does not seem all that large. Making the protocol descritpion 
> say that it is an out-of-band block of memory, instead of a file 
> descriptor, may help but may also be unnecessary obfuscation.

That is exactly what file descriptors in the protocol are most often
used for. It's a standard design pattern in Wayland.

The use is documented even:
http://wayland.freedesktop.org/docs/html/protocol-spec-interface-wl_keyboard.html

"This event provides a file descriptor to the client which can be
memory-mapped to provide a keyboard mapping description."

Memory-mapped. With size. I have no idea what cutoff you refer to.

The data does not fit in a few dozen bytes, nor even a kilobyte, so yes,
it is best sent in a zero-copy way to avoid clogging the Wayland
connection buffers.


Thanks,
pq


More information about the wayland-devel mailing list