diff options
author | Daniel Stone <daniel@fooishbar.org> | 2012-06-22 13:21:37 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-22 11:52:07 -0400 |
commit | 1b4e11f38e5ed7abb85e599483a62cb303cc543d (patch) | |
tree | f09767a628d44f567995e109ce63a353cd420179 /src/compositor.c | |
parent | 3ee91e1879301573a320551a19f99da0a715ff86 (diff) |
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>
Diffstat (limited to 'src/compositor.c')
-rw-r--r-- | src/compositor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compositor.c b/src/compositor.c index 1d57316b..5362a67e 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1833,7 +1833,8 @@ update_modifier_state(struct weston_seat *seat, uint32_t key, WL_EXPORT void notify_key(struct wl_seat *seat, uint32_t time, uint32_t key, - enum wl_keyboard_key_state state) + enum wl_keyboard_key_state state, + enum weston_key_state_update update_state) { struct weston_seat *ws = (struct weston_seat *) seat; struct weston_compositor *compositor = ws->compositor; @@ -1842,7 +1843,7 @@ notify_key(struct wl_seat *seat, uint32_t time, uint32_t key, struct wl_keyboard_grab *grab = seat->keyboard->grab; uint32_t serial = wl_display_next_serial(compositor->wl_display); uint32_t *k, *end; - int mods; + int mods = 0; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (compositor->ping_handler && focus) @@ -1855,7 +1856,8 @@ notify_key(struct wl_seat *seat, uint32_t time, uint32_t key, weston_compositor_idle_release(compositor); } - mods = update_modifier_state(ws, key, state); + if (update_state == STATE_UPDATE_AUTOMATIC) + mods = update_modifier_state(ws, key, state); end = seat->keyboard->keys.data + seat->keyboard->keys.size; for (k = seat->keyboard->keys.data; k < end; k++) { if (*k == key) { |