diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-28 13:46:09 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-28 13:46:09 -0400 |
commit | c7cd626bcfdc61385ffb7ccb065c5c815641a3b9 (patch) | |
tree | 664e9885beb0057ed04ac817424411b4fdb8efaf /src | |
parent | 061c4253317fff4d6021685c7e4c506d4cef4542 (diff) |
compositor: Update xkb state with key releases on focus out
This happens when vt-switching away from the compositor (drm) or
giving keyboard focus to a different X window. Release the modifiers
so we don't get stuck modifiers. We'll update with the new keys down
when we come back.
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor.c | 15 | ||||
-rw-r--r-- | src/shell.c | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/compositor.c b/src/compositor.c index b4e430ba..8cf66bbe 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1936,15 +1936,14 @@ notify_keyboard_focus_in(struct wl_seat *seat, struct wl_array *keys, struct weston_seat *ws = (struct weston_seat *) seat; struct weston_compositor *compositor = ws->compositor; struct wl_surface *surface; - uint32_t *k; + uint32_t *k, serial; + serial = wl_display_next_serial(compositor->wl_display); wl_array_copy(&seat->keyboard->keys, keys); wl_array_for_each(k, &seat->keyboard->keys) { weston_compositor_idle_inhibit(compositor); if (update_state == STATE_UPDATE_AUTOMATIC) - update_modifier_state(ws, - wl_display_next_serial(compositor->wl_display), - *k, + update_modifier_state(ws, serial, *k, WL_KEYBOARD_KEY_STATE_PRESSED); } @@ -1969,10 +1968,14 @@ notify_keyboard_focus_out(struct wl_seat *seat) struct weston_seat *ws = (struct weston_seat *) seat; struct weston_compositor *compositor = ws->compositor; struct wl_surface *surface; - uint32_t *k; + uint32_t *k, serial; - wl_array_for_each(k, &seat->keyboard->keys) + serial = wl_display_next_serial(compositor->wl_display); + wl_array_for_each(k, &seat->keyboard->keys) { weston_compositor_idle_release(compositor); + update_modifier_state(ws, serial, *k, + WL_KEYBOARD_KEY_STATE_RELEASED); + } ws->modifier_state = 0; diff --git a/src/shell.c b/src/shell.c index 5d79e2e0..2e1e22a3 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1852,7 +1852,7 @@ configure_static_surface(struct weston_surface *es, struct weston_layer *layer) if (wl_list_empty(&es->layer_link)) { wl_list_insert(&layer->surface_list, &es->layer_link); - weston_surface_assign_output(es); + weston_compositor_schedule_repaint(es->compositor); } } |