diff options
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/keyboard.c | 12 | ||||
-rw-r--r-- | rootston/main.c | 6 |
2 files changed, 11 insertions, 7 deletions
diff --git a/rootston/keyboard.c b/rootston/keyboard.c index 4aaf2d48..758a49fb 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -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; diff --git a/rootston/main.c b/rootston/main.c index d17079d3..27ff6b41 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -30,11 +30,7 @@ int main(int argc, char **argv) { assert(server.wl_display = wl_display_create()); assert(server.wl_event_loop = wl_display_get_event_loop(server.wl_display)); - //assert(server.backend = wlr_backend_autocreate(server.wl_display)); - assert(server.backend = wlr_headless_backend_create(server.wl_display)); - wlr_headless_add_output(server.backend, 1280, 720); - wlr_headless_add_input_device(server.backend, WLR_INPUT_DEVICE_KEYBOARD); - wlr_headless_add_input_device(server.backend, WLR_INPUT_DEVICE_POINTER); + assert(server.backend = wlr_backend_autocreate(server.wl_display)); assert(server.renderer = wlr_gles2_renderer_create(server.backend)); server.data_device_manager = |