Skip to content

Use read-only anonymous file abstraction for wayland-keymap sharing

Jonas Dreßler requested to merge verdre/mutter:anon-read-only-files into master

Add ro_anonymous_file, an abstraction around anonymous read-only files. Files can be created by calling os_ro_anonymous_file_create(), passing the data of the file. Subsequent calls to os_ro_anonymous_file_get_fd() return a fd that's ready to be send over the socket.

Use this new abstraction in meta-wayland-keyboard for sending keymap data to the clients without having to copy it unnecessarily.

Pretty much all of this code was written for Weston by Sebastian Wick, see https://gitlab.freedesktop.org/wayland/weston/merge_requests/240.

@swick Since I pretty much copy-pasted your code, I added you as Co-authored-by in the commit messages, would you prefer to be the author of the commits or a different way of attribution?

Fixes gnome-shell#1734 (closed)

Edited by Jonas Dreßler

Merge request reports