mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
Do not segfault when loading an unknown keymap
This commit is contained in:
parent
f3769a4b1f
commit
2c31cac116
2 changed files with 15 additions and 5 deletions
|
|
@ -354,8 +354,16 @@ struct roots_keyboard *roots_keyboard_create(struct wlr_input_device *device,
|
|||
wlr_log(L_ERROR, "Cannot create XKB context");
|
||||
return NULL;
|
||||
}
|
||||
wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context,
|
||||
&rules, XKB_KEYMAP_COMPILE_NO_FLAGS));
|
||||
|
||||
struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules,
|
||||
XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
if (keymap == NULL) {
|
||||
xkb_context_unref(context);
|
||||
wlr_log(L_ERROR, "Cannot create XKB keymap");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wlr_keyboard_set_keymap(device->keyboard, keymap);
|
||||
xkb_context_unref(context);
|
||||
|
||||
int repeat_rate = (config->repeat_rate > 0) ? config->repeat_rate : 25;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue