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 c31288daf1.
This commit is contained in:
@@ -46,6 +46,7 @@ struct compose_seq {
|
|||||||
struct simple_im {
|
struct simple_im {
|
||||||
struct input_method *input_method;
|
struct input_method *input_method;
|
||||||
struct input_method_context *context;
|
struct input_method_context *context;
|
||||||
|
struct xkb_context *xkb_context;
|
||||||
struct display *display;
|
struct display *display;
|
||||||
struct wl_keyboard *keyboard;
|
struct wl_keyboard *keyboard;
|
||||||
struct keyboard_input *keyboard_input;
|
struct keyboard_input *keyboard_input;
|
||||||
@@ -464,8 +465,14 @@ main(int argc, char *argv[])
|
|||||||
return -1;
|
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.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_user_data(simple_im.keyboard_input, &simple_im);
|
||||||
keyboard_input_set_key_handler(simple_im.keyboard_input, simple_im_key_handler);
|
keyboard_input_set_key_handler(simple_im.keyboard_input, simple_im_key_handler);
|
||||||
|
|
||||||
|
|||||||
@@ -4024,12 +4024,6 @@ display_get_serial(struct display *display)
|
|||||||
return display->serial;
|
return display->serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct xkb_context *
|
|
||||||
display_get_xkb_context(struct display *display)
|
|
||||||
{
|
|
||||||
return display->xkb_context;
|
|
||||||
}
|
|
||||||
|
|
||||||
EGLDisplay
|
EGLDisplay
|
||||||
display_get_egl_display(struct display *d)
|
display_get_egl_display(struct display *d)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,9 +79,6 @@ display_get_output(struct display *display);
|
|||||||
uint32_t
|
uint32_t
|
||||||
display_get_serial(struct display *display);
|
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,
|
typedef void (*display_global_handler_t)(struct display *display,
|
||||||
uint32_t name,
|
uint32_t name,
|
||||||
const char *interface,
|
const char *interface,
|
||||||
|
|||||||
Reference in New Issue
Block a user