1From 86a1eecf27d4bdb253eaa233868667c6a97ef215 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Thu, 15 Oct 2020 12:43:00 +0800
4Subject: [PATCH 30/79] compositor: Force the first app on bottom in warm-up
5 mode
6
7When warm-up enabled, assume the first app is a launcher and put it on
8the bottom layer.
9
10Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
11---
12 compositor/main.c      | 3 +++
13 libweston/compositor.c | 3 +++
14 2 files changed, 6 insertions(+)
15
16diff --git a/compositor/main.c b/compositor/main.c
17index 3824404..2010c02 100644
18--- a/compositor/main.c
19+++ b/compositor/main.c
20@@ -3532,6 +3532,9 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
21 	if (idle_time < 0)
22 		idle_time = 300; /* default idle timeout, in seconds */
23
24+	if (!warm_up)
25+		weston_config_section_get_bool(section, "warm-up", &warm_up, false);
26+
27 	wet.compositor->idle_time = idle_time;
28 	wet.compositor->default_pointer_grab = NULL;
29 	wet.compositor->exit = handle_exit;
30diff --git a/libweston/compositor.c b/libweston/compositor.c
31index 67766df..af69ab3 100644
32--- a/libweston/compositor.c
33+++ b/libweston/compositor.c
34@@ -2903,6 +2903,9 @@ weston_compositor_build_view_list(struct weston_compositor *compositor,
35 			if (compositor->warm_up && !system_layer) {
36 				weston_log("seeing the first app\n");
37 				compositor->warm_up = false;
38+
39+				/* Assuming it's a launcher */
40+				view->surface->flags |= SURFACE_STAY_ON_BOTTOM;
41 			}
42
43 			view_list_add(compositor, view, output);
44--
452.20.1
46
47