From 8c03616c3931a8cb4a8a0e52a27a9c8866d58a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 27 Nov 2012 13:47:16 -0500 Subject: [PATCH] weston-simple-im: Create our own xkb_context There's no need to use the struct display xkb_context, we can just create out ow. This reverts c31288daf1ac379c278a00c3291760ec2639eae7. --- clients/weston-simple-im.c | 9 ++++++++- clients/window.c | 6 ------ clients/window.h | 3 --- 3 files changed, 8 insertions(+), 10 deletions(-) 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,