1*4882a593SmuzhiyunFrom a598ac0d549c8907fbcb177140642da5679300da Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Jeffy Chen <jeffy.chen@rock-chips.com> 3*4882a593SmuzhiyunDate: Fri, 24 Jun 2022 16:25:11 +0800 4*4882a593SmuzhiyunSubject: [PATCH 72/93] desktop-shell: Avoid lowering the requested fullscreen 5*4882a593Smuzhiyun surface 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunDon't lower itself. 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunSigned-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 10*4882a593Smuzhiyun--- 11*4882a593Smuzhiyun desktop-shell/shell.c | 9 +++++---- 12*4882a593Smuzhiyun desktop-shell/shell.h | 3 ++- 13*4882a593Smuzhiyun 2 files changed, 7 insertions(+), 5 deletions(-) 14*4882a593Smuzhiyun 15*4882a593Smuzhiyundiff --git a/desktop-shell/shell.c b/desktop-shell/shell.c 16*4882a593Smuzhiyunindex 1da402a..08c84c5 100644 17*4882a593Smuzhiyun--- a/desktop-shell/shell.c 18*4882a593Smuzhiyun+++ b/desktop-shell/shell.c 19*4882a593Smuzhiyun@@ -3327,7 +3327,8 @@ rotate_binding(struct weston_pointer *pointer, const struct timespec *time, 20*4882a593Smuzhiyun * the alt-tab switcher, which need to de-promote fullscreen layers. */ 21*4882a593Smuzhiyun void 22*4882a593Smuzhiyun lower_fullscreen_layer(struct desktop_shell *shell, 23*4882a593Smuzhiyun- struct weston_output *lowering_output) 24*4882a593Smuzhiyun+ struct weston_output *lowering_output, 25*4882a593Smuzhiyun+ struct shell_surface *orig_shsurf) 26*4882a593Smuzhiyun { 27*4882a593Smuzhiyun struct workspace *ws; 28*4882a593Smuzhiyun struct weston_view *view, *prev; 29*4882a593Smuzhiyun@@ -3338,7 +3339,7 @@ lower_fullscreen_layer(struct desktop_shell *shell, 30*4882a593Smuzhiyun layer_link.link) { 31*4882a593Smuzhiyun struct shell_surface *shsurf = get_shell_surface(view->surface); 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun- if (!shsurf) 34*4882a593Smuzhiyun+ if (!shsurf || shsurf == orig_shsurf) 35*4882a593Smuzhiyun continue; 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun /* Only lower surfaces which have lowering_output as their fullscreen 38*4882a593Smuzhiyun@@ -3405,7 +3406,7 @@ activate(struct desktop_shell *shell, struct weston_view *view, 39*4882a593Smuzhiyun /* Only demote fullscreen surfaces on the output of activated shsurf. 40*4882a593Smuzhiyun * Leave fullscreen surfaces on unrelated outputs alone. */ 41*4882a593Smuzhiyun if (shsurf->output) 42*4882a593Smuzhiyun- lower_fullscreen_layer(shell, shsurf->output); 43*4882a593Smuzhiyun+ lower_fullscreen_layer(shell, shsurf->output, shsurf); 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun if (view->surface->flags & SURFACE_NO_FOCUS) 46*4882a593Smuzhiyun goto no_focus; 47*4882a593Smuzhiyun@@ -4234,7 +4235,7 @@ switcher_binding(struct weston_keyboard *keyboard, const struct timespec *time, 48*4882a593Smuzhiyun wl_list_init(&switcher->listener.link); 49*4882a593Smuzhiyun wl_array_init(&switcher->minimized_array); 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun- lower_fullscreen_layer(switcher->shell, NULL); 52*4882a593Smuzhiyun+ lower_fullscreen_layer(switcher->shell, NULL, NULL); 53*4882a593Smuzhiyun switcher->grab.interface = &switcher_grab; 54*4882a593Smuzhiyun weston_keyboard_start_grab(keyboard, &switcher->grab); 55*4882a593Smuzhiyun weston_keyboard_set_focus(keyboard, NULL); 56*4882a593Smuzhiyundiff --git a/desktop-shell/shell.h b/desktop-shell/shell.h 57*4882a593Smuzhiyunindex 6876cf3..3372679 100644 58*4882a593Smuzhiyun--- a/desktop-shell/shell.h 59*4882a593Smuzhiyun+++ b/desktop-shell/shell.h 60*4882a593Smuzhiyun@@ -177,7 +177,8 @@ get_output_work_area(struct desktop_shell *shell, 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun void 63*4882a593Smuzhiyun lower_fullscreen_layer(struct desktop_shell *shell, 64*4882a593Smuzhiyun- struct weston_output *lowering_output); 65*4882a593Smuzhiyun+ struct weston_output *lowering_output, 66*4882a593Smuzhiyun+ struct shell_surface *orig_shsurf); 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun void 69*4882a593Smuzhiyun activate(struct desktop_shell *shell, struct weston_view *view, 70*4882a593Smuzhiyun-- 71*4882a593Smuzhiyun2.20.1 72*4882a593Smuzhiyun 73