hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From 2279df460ebe9f55747d8e69aaf60d19600b0b1a Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Fri, 24 Jun 2022 16:25:11 +0800
Subject: [PATCH 72/74] desktop-shell: Avoid lowering the requested fullscreen
 surface
 
Don't lower itself.
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 desktop-shell/exposay.c | 2 +-
 desktop-shell/shell.c   | 9 +++++----
 desktop-shell/shell.h   | 3 ++-
 3 files changed, 8 insertions(+), 6 deletions(-)
 
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
index c7c064b..0981f1a 100644
--- a/desktop-shell/exposay.c
+++ b/desktop-shell/exposay.c
@@ -646,7 +646,7 @@ exposay_transition_active(struct desktop_shell *shell)
     shell->exposay.clicked = NULL;
     wl_list_init(&shell->exposay.surface_list);
 
-    lower_fullscreen_layer(shell, NULL);
+    lower_fullscreen_layer(shell, NULL, NULL);
     shell->exposay.grab_kbd.interface = &exposay_kbd_grab;
     weston_keyboard_start_grab(keyboard,
                                &shell->exposay.grab_kbd);
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index cc0246e..dbb62e9 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3747,7 +3747,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;
@@ -3758,7 +3759,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
@@ -3826,7 +3827,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;
@@ -4657,7 +4658,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 e0a0620..269648a 100644
--- a/desktop-shell/shell.h
+++ b/desktop-shell/shell.h
@@ -242,7 +242,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