From 5d5e8642c9751613e451d1d721574e9243cb33b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez?= Date: Mon, 24 Jul 2023 19:05:50 -0500 Subject: [PATCH] kiosk-shell: Set the new active surface tree for inactive focus successor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have a successor view that comes from the inactive layer, this means that we have a change in the active surface tree, so call kiosk_shell_output_set_active_surface_tree() on the root of that view's kiosk surface. If we have no successors, just reset the current active surface tree. Signed-off-by: Sergio Gómez --- kiosk-shell/kiosk-shell.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c index 4c2c06a37..26e86c9cd 100644 --- a/kiosk-shell/kiosk-shell.c +++ b/kiosk-shell/kiosk-shell.c @@ -831,14 +831,28 @@ desktop_surface_removed(struct weston_desktop_surface *desktop_surface, (kiosk_seat->focused_surface == surface || surface->output != kiosk_seat->focused_surface->output)) { struct kiosk_shell_surface *successor; + struct kiosk_shell_output *shoutput; successor = find_focus_successor(shsurf, kiosk_seat->focused_surface); - if (successor) { + shoutput = kiosk_shell_find_shell_output(shsurf->shell, shsurf->output); + if (shoutput && successor) { + enum weston_layer_position succesor_view_layer_pos; + + succesor_view_layer_pos = weston_shell_utils_view_get_layer_position(successor->view); + if (succesor_view_layer_pos == WESTON_LAYER_POSITION_HIDDEN) { + struct kiosk_shell_surface *shroot = + kiosk_shell_surface_get_parent_root(successor); + + kiosk_shell_output_set_active_surface_tree(shoutput, + shroot); + } kiosk_shell_surface_activate(successor, kiosk_seat, WESTON_ACTIVATE_FLAG_NONE); } else { kiosk_seat->focused_surface = NULL; + kiosk_shell_output_set_active_surface_tree(shoutput, + NULL); } }