input: use ro_anonymous_file to minimize duplication of keymap files

Since version 7 clients must use MAP_PRIVATE to map the keymap fd so we
can use memfd_create in os_ro_anonymous_file_get_ref using
RO_ANONYMOUS_FILE_MAPMODE_PRIVATE, for older version we use
RO_ANONYMOUS_FILE_MAPMODE_SHARED to be compatibile with MAP_SHARED.

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
This commit is contained in:
Sebastian Wick
2019-11-01 02:38:45 +01:00
parent ac1b92dfea
commit abec512883
2 changed files with 34 additions and 25 deletions
+2 -2
View File
@@ -78,6 +78,7 @@ struct weston_pointer;
struct linux_dmabuf_buffer;
struct weston_recorder;
struct weston_pointer_constraint;
struct ro_anonymous_file;
enum weston_keyboard_modifier {
MODIFIER_CTRL = (1 << 0),
@@ -704,8 +705,7 @@ weston_pointer_start_drag(struct weston_pointer *pointer,
struct wl_client *client);
struct weston_xkb_info {
struct xkb_keymap *keymap;
size_t keymap_size;
char *keymap_string;
struct ro_anonymous_file *keymap_rofile;
int32_t ref_count;
xkb_mod_index_t shift_mod;
xkb_mod_index_t caps_mod;