notify_key: Add update_state argument
If update_state is true, then notify_key will continue to call
xkb_key_update_state to update the local state mask, as before this
commit. Otherwise, it will rely on the compositor to manually update
the state itself, for nested compositors.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 7738bd0..bda7638 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -710,7 +710,8 @@
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_release->detail - 8,
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
free(prev);
prev = NULL;
break;
@@ -753,7 +754,8 @@
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_press->detail - 8,
- WL_KEYBOARD_KEY_STATE_PRESSED);
+ WL_KEYBOARD_KEY_STATE_PRESSED,
+ STATE_UPDATE_AUTOMATIC);
break;
case XCB_KEY_RELEASE:
/* If we don't have XKB, we need to use the lame
@@ -766,7 +768,8 @@
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_release->detail - 8,
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
break;
case XCB_BUTTON_PRESS:
x11_compositor_deliver_button_event(c, event, 1);
@@ -848,7 +851,8 @@
notify_key(&c->base.seat->seat,
weston_compositor_get_time(),
key_release->detail - 8,
- WL_KEYBOARD_KEY_STATE_RELEASED);
+ WL_KEYBOARD_KEY_STATE_RELEASED,
+ STATE_UPDATE_AUTOMATIC);
free(prev);
prev = NULL;
break;