From e22238d293a882aa5c0c7219378ef03d6aa4db74 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Fri, 24 Jun 2022 16:25:11 +0800 Subject: [PATCH 71/92] desktop-shell: Avoid lowering the requested fullscreen surface Don't lower itself. Signed-off-by: Jeffy Chen --- desktop-shell/shell.c | 9 +++++---- desktop-shell/shell.h | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 1da402a..08c84c5 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3327,7 +3327,8 @@ rotate_binding(struct weston_pointer *pointer, const struct timespec *time, * the alt-tab switcher, which need to de-promote fullscreen layers. */ void lower_fullscreen_layer(struct desktop_shell *shell, - struct weston_output *lowering_output) + struct weston_output *lowering_output, + struct shell_surface *orig_shsurf) { struct workspace *ws; struct weston_view *view, *prev; @@ -3338,7 +3339,7 @@ lower_fullscreen_layer(struct desktop_shell *shell, layer_link.link) { struct shell_surface *shsurf = get_shell_surface(view->surface); - if (!shsurf) + if (!shsurf || shsurf == orig_shsurf) continue; /* Only lower surfaces which have lowering_output as their fullscreen @@ -3405,7 +3406,7 @@ activate(struct desktop_shell *shell, struct weston_view *view, /* Only demote fullscreen surfaces on the output of activated shsurf. * Leave fullscreen surfaces on unrelated outputs alone. */ if (shsurf->output) - lower_fullscreen_layer(shell, shsurf->output); + lower_fullscreen_layer(shell, shsurf->output, shsurf); if (view->surface->flags & SURFACE_NO_FOCUS) goto no_focus; @@ -4234,7 +4235,7 @@ switcher_binding(struct weston_keyboard *keyboard, const struct timespec *time, wl_list_init(&switcher->listener.link); wl_array_init(&switcher->minimized_array); - lower_fullscreen_layer(switcher->shell, NULL); + lower_fullscreen_layer(switcher->shell, NULL, NULL); switcher->grab.interface = &switcher_grab; weston_keyboard_start_grab(keyboard, &switcher->grab); weston_keyboard_set_focus(keyboard, NULL); diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h index 6876cf3..3372679 100644 --- a/desktop-shell/shell.h +++ b/desktop-shell/shell.h @@ -177,7 +177,8 @@ get_output_work_area(struct desktop_shell *shell, void lower_fullscreen_layer(struct desktop_shell *shell, - struct weston_output *lowering_output); + struct weston_output *lowering_output, + struct shell_surface *orig_shsurf); void activate(struct desktop_shell *shell, struct weston_view *view, -- 2.20.1