Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/wayland_keyboard.c:
{
- FIXME("stub!\n");
- struct wayland_keyboard *keyboard = &process_wayland.keyboard;
- struct xkb_keymap *xkb_keymap = NULL;
- struct xkb_state *xkb_state;
- char *keymap_str;
- TRACE("format=%d fd=%d size=%d\n", format, fd, size);
- if ((keymap_str = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0)) != MAP_FAILED)
- {
if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1)
FIXME("Unsupported keymap format %#x\n", format);
else
{
struct xkb_context *xkb_context = wayland_keyboard_get_xkb_context();
We can use `wayland_keyboard.xkb_context` directly here (we don't even need to ref).
All the handlers (including the registry handlers which call keyboard init/deinit) are called from the same thread. Since the `xkb_context` field is only ever set from init/deinit, we are guaranteed to not have a race in this handler.