diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2021-02-27 23:41:39 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2021-02-28 19:37:41 +0200 |
commit | e62ccf179afa98bb29cc35d8c83aea1c37f41409 (patch) | |
tree | 52cce6536b8eb474f825a857f07f630a30a4c37c | |
parent | f65ba188533290ff9769d32909737bd91657abe6 (diff) | |
download | weston-e62ccf179afa98bb29cc35d8c83aea1c37f41409.tar.gz |
kiosk-shell: Give keyboard focus when mapping the surface
Doing it when the surface is being added would cause clients that
wait for frame callbacks to wait indefinitely as the surface being
activated is not yet, committed.
Fixes: #473
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
-rw-r--r-- | kiosk-shell/kiosk-shell.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c index 24989ee2..c25d139e 100644 --- a/kiosk-shell/kiosk-shell.c +++ b/kiosk-shell/kiosk-shell.c @@ -556,16 +556,12 @@ desktop_surface_added(struct weston_desktop_surface *desktop_surface, { struct kiosk_shell *shell = data; struct kiosk_shell_surface *shsurf; - struct weston_seat *seat; shsurf = kiosk_shell_surface_create(shell, desktop_surface); if (!shsurf) return; kiosk_shell_surface_set_fullscreen(shsurf, NULL); - - wl_list_for_each(seat, &shell->compositor->seat_list, link) - weston_view_activate(shsurf->view, seat, 0); } /* Return the view that should gain focus after the specified shsurf is @@ -671,10 +667,15 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface, } if (!weston_surface_is_mapped(surface)) { + struct weston_seat *seat; + weston_layer_entry_insert(&shsurf->shell->normal_layer.view_list, &shsurf->view->layer_link); shsurf->view->is_mapped = true; surface->is_mapped = true; + + wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) + weston_view_activate(shsurf->view, seat, 0); } if (!is_fullscreen && (sx != 0 || sy != 0)) { |