diff --git a/clients/weston-simple-im.c b/clients/weston-simple-im.c index 0583ebe2..693e2bf0 100644 --- a/clients/weston-simple-im.c +++ b/clients/weston-simple-im.c @@ -46,6 +46,7 @@ struct compose_seq { struct simple_im { struct input_method *input_method; struct input_method_context *context; + struct xkb_context *xkb_context; struct display *display; struct wl_keyboard *keyboard; struct keyboard_input *keyboard_input; @@ -464,8 +465,14 @@ main(int argc, char *argv[]) return -1; } + simple_im.xkb_context = xkb_context_new(0); + if (simple_im.xkb_context == NULL) { + fprintf(stderr, "Failed to create XKB context\n"); + return -1; + } + simple_im.context = NULL; - simple_im.keyboard_input = keyboard_input_create(display_get_xkb_context(simple_im.display)); + simple_im.keyboard_input = keyboard_input_create(simple_im.xkb_context); keyboard_input_set_user_data(simple_im.keyboard_input, &simple_im); keyboard_input_set_key_handler(simple_im.keyboard_input, simple_im_key_handler); diff --git a/clients/window.c b/clients/window.c index 9cfc1b97..c3365ba1 100644 --- a/clients/window.c +++ b/clients/window.c @@ -4024,12 +4024,6 @@ display_get_serial(struct display *display) return display->serial; } -struct xkb_context * -display_get_xkb_context(struct display *display) -{ - return display->xkb_context; -} - EGLDisplay display_get_egl_display(struct display *d) { diff --git a/clients/window.h b/clients/window.h index 482b86c7..9b820a06 100644 --- a/clients/window.h +++ b/clients/window.h @@ -79,9 +79,6 @@ display_get_output(struct display *display); uint32_t display_get_serial(struct display *display); -struct xkb_context * -display_get_xkb_context(struct display *display); - typedef void (*display_global_handler_t)(struct display *display, uint32_t name, const char *interface,