kiosk-shell: Set the new active surface tree for inactive focus successor

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 <sergio.g.delreal@gmail.com>
This commit is contained in:
Sergio Gómez 2023-07-24 19:05:50 -05:00 committed by Marius Vlad
parent cc837eea61
commit 5d5e8642c9
1 changed files with 15 additions and 1 deletions

View File

@ -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);
}
}