mirror of
https://github.com/brl/mutter.git
synced 2025-07-11 21:17:18 +00:00
wayland/keyboard: Use MetaAnonymousFile to share keymap files
Since protocol version 7 clients must use MAP_PRIVATE to map the keymap fd, that means we can use memfd_create() to create the fd by using meta_anonymous_file_open_fd() with META_ANONYMOUS_FILE_MAPMODE_PRIVATE, for older versions we use META_ANONYMOUS_FILE_MAPMODE_SHARED to be compatibile with MAP_SHARED. Pretty much all of this code was written for Weston by Sebastian Wick, see https://gitlab.freedesktop.org/wayland/weston/merge_requests/240. Co-authored-by: Sebastian Wick <sebastian@sebastianwick.net> Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1734 https://gitlab.gnome.org/GNOME/mutter/merge_requests/1012
This commit is contained in:
@ -49,6 +49,7 @@
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#include "clutter/clutter.h"
|
||||
#include "core/meta-anonymous-file.h"
|
||||
#include "wayland/meta-wayland-types.h"
|
||||
|
||||
#define META_TYPE_WAYLAND_KEYBOARD (meta_wayland_keyboard_get_type ())
|
||||
@ -74,8 +75,7 @@ typedef struct
|
||||
{
|
||||
struct xkb_keymap *keymap;
|
||||
struct xkb_state *state;
|
||||
size_t keymap_size;
|
||||
char *keymap_string;
|
||||
MetaAnonymousFile *keymap_rofile;
|
||||
} MetaWaylandXkbInfo;
|
||||
|
||||
struct _MetaWaylandKeyboard
|
||||
|
Reference in New Issue
Block a user