mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 03:45:58 +01:00
seat: allow compositors to not load a keymap
The protocol allows compositors to not send any keymap to Wayland clients. Handle a keymap-less keyboard correctly by sending WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP instead of erroring out in the mmap call.
This commit is contained in:
parent
d48ffac56b
commit
c27263c105
1 changed files with 7 additions and 0 deletions
|
@ -370,6 +370,13 @@ static void seat_client_send_keymap(struct wlr_seat_client *client,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keyboard->keymap == NULL) {
|
||||||
|
wl_keyboard_send_keymap(resource,
|
||||||
|
WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP, keymap_fd, 0);
|
||||||
|
close(keymap_fd);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
void *ptr = mmap(NULL, keyboard->keymap_size, PROT_READ | PROT_WRITE,
|
void *ptr = mmap(NULL, keyboard->keymap_size, PROT_READ | PROT_WRITE,
|
||||||
MAP_SHARED, keymap_fd, 0);
|
MAP_SHARED, keymap_fd, 0);
|
||||||
if (ptr == MAP_FAILED) {
|
if (ptr == MAP_FAILED) {
|
||||||
|
|
Loading…
Reference in a new issue