1From 682f77a57e5cb73650f93aba957b7ba82f23b424 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Tue, 23 Mar 2021 22:34:54 +0800
4Subject: [PATCH 45/93] desktop-shell: Disable fullscreen black background by
5 default
6
7There's a force black background for fullscreen views.
8
9Let's disable it by default, set this env to enable:
10"WESTON_FULLSCREEN_BLACK_BACKGROUND"
11
12Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
13---
14 desktop-shell/shell.c | 7 ++++---
15 1 file changed, 4 insertions(+), 3 deletions(-)
16
17diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
18index e48db31..fb410ba 100644
19--- a/desktop-shell/shell.c
20+++ b/desktop-shell/shell.c
21@@ -1691,7 +1691,8 @@ shell_configure_fullscreen(struct shell_surface *shsurf)
22 		return;
23 	}
24
25-	shell_ensure_fullscreen_black_view(shsurf);
26+	if (getenv("WESTON_FULLSCREEN_BLACK_BACKGROUND"))
27+		shell_ensure_fullscreen_black_view(shsurf);
28
29 	surface_subsurfaces_boundingbox(surface, &surf_x, &surf_y,
30 	                                &surf_width, &surf_height);
31@@ -3332,7 +3333,7 @@ lower_fullscreen_layer(struct desktop_shell *shell,
32
33 		/* We can have a non-fullscreen popup for a fullscreen surface
34 		 * in the fullscreen layer. */
35-		if (weston_desktop_surface_get_fullscreen(shsurf->desktop_surface)) {
36+		if (weston_desktop_surface_get_fullscreen(shsurf->desktop_surface) && shsurf->fullscreen.black_view) {
37 			/* Hide the black view */
38 			weston_layer_entry_remove(&shsurf->fullscreen.black_view->view->layer_link);
39 			wl_list_init(&shsurf->fullscreen.black_view->view->layer_link.link);
40@@ -4099,7 +4100,7 @@ switcher_next(struct switcher *switcher)
41 		view->alpha = 1.0;
42
43 	shsurf = get_shell_surface(switcher->current->surface);
44-	if (shsurf && weston_desktop_surface_get_fullscreen(shsurf->desktop_surface))
45+	if (shsurf && weston_desktop_surface_get_fullscreen(shsurf->desktop_surface) && shsurf->fullscreen.black_view)
46 		shsurf->fullscreen.black_view->view->alpha = 1.0;
47 }
48
49--
502.20.1
51
52