summaryrefslogtreecommitdiff
path: root/clients/weston-simple-im.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-11-27 13:57:27 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-11-27 13:57:27 -0500
commit79bfde20bd782588a4747ebf15a0d17e5b1b3a7a (patch)
tree3cfafded198f57b57255e53d0ca301ce381fdb34 /clients/weston-simple-im.c
parent8c03616c3931a8cb4a8a0e52a27a9c8866d58a61 (diff)
weston-simple-im: Use serial number from incoming events
The key events we pass through to the input_method_context has to have a serial number that corresponds to the key event we got. The struct display serial is updated on pointer enter/leave and keyboard events, but not the input method keyboard events. So the display serial will never correspond to the key event we're dealing with and we have to pass through the serial we get from the key event.
Diffstat (limited to 'clients/weston-simple-im.c')
-rw-r--r--clients/weston-simple-im.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/clients/weston-simple-im.c b/clients/weston-simple-im.c
index 693e2bf0..0e805746 100644
--- a/clients/weston-simple-im.c
+++ b/clients/weston-simple-im.c
@@ -74,6 +74,7 @@ static const uint32_t ignore_keys_on_compose[] = {
};
typedef void (*keyboard_input_key_handler_t)(struct keyboard_input *keyboard_input,
+ uint32_t serial,
uint32_t time, uint32_t key, uint32_t unicode,
enum wl_keyboard_key_state state, void *data);
@@ -170,7 +171,7 @@ keyboard_input_handle_key(struct keyboard_input *keyboard_input,
sym = syms[0];
if (keyboard_input->key_handler)
- (*keyboard_input->key_handler)(keyboard_input, time, key, sym,
+ (*keyboard_input->key_handler)(keyboard_input, serial, time, key, sym,
state, keyboard_input->user_data);
}
@@ -367,7 +368,7 @@ compare_compose_keys(const void *c1, const void *c2)
static void
simple_im_key_handler(struct keyboard_input *keyboard_input,
- uint32_t time, uint32_t key, uint32_t sym,
+ uint32_t serial, uint32_t time, uint32_t key, uint32_t sym,
enum wl_keyboard_key_state state, void *data)
{
struct simple_im *keyboard = data;
@@ -391,7 +392,7 @@ simple_im_key_handler(struct keyboard_input *keyboard_input,
for (i = 0; i < sizeof(ignore_keys_on_compose) / sizeof(ignore_keys_on_compose[0]); i++) {
if (sym == ignore_keys_on_compose[i]) {
- input_method_context_key(context, display_get_serial(keyboard->display), time, key, state);
+ input_method_context_key(context, serial, time, key, state);
return;
}
}
@@ -440,7 +441,7 @@ simple_im_key_handler(struct keyboard_input *keyboard_input,
}
if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0) {
- input_method_context_key(context, display_get_serial(keyboard->display), time, key, state);
+ input_method_context_key(context, serial, time, key, state);
return;
}