1From 87315047d46abfa39d7bb663ecbce071d8aa9cf7 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Fri, 2 Apr 2021 01:50:22 +0800
4Subject: [PATCH 43/79] desktop-shell: Resize views when work area changed
5
6Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
7---
8 desktop-shell/shell.c | 14 ++++++++++++++
9 1 file changed, 14 insertions(+)
10
11diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
12index ce6d660..f572f8f 100644
13--- a/desktop-shell/shell.c
14+++ b/desktop-shell/shell.c
15@@ -48,6 +48,10 @@
16 #define DEFAULT_NUM_WORKSPACES 1
17 #define DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH 200
18
19+static void
20+handle_output_resize_layer(struct desktop_shell *shell,
21+			   struct weston_layer *layer, void *data);
22+
23 struct focus_state {
24 	struct desktop_shell *shell;
25 	struct weston_seat *seat;
26@@ -3052,6 +3056,7 @@ panel_committed(struct weston_surface *es, int32_t sx, int32_t sy)
27 {
28 	struct desktop_shell *shell = es->committed_private;
29 	struct weston_view *view;
30+	pixman_rectangle32_t old_area, new_area;
31 	int width, height;
32 	int x = 0, y = 0;
33
34@@ -3071,7 +3076,16 @@ panel_committed(struct weston_surface *es, int32_t sx, int32_t sy)
35 		break;
36 	}
37
38+	get_output_work_area(shell, view->output, &old_area);
39 	configure_static_view(view, &shell->panel_layer, x, y);
40+	get_output_work_area(shell, view->output, &new_area);
41+
42+	if (old_area.x == new_area.x && old_area.y == new_area.y &&
43+	    old_area.width == new_area.width &&
44+	    old_area.height == new_area.height)
45+		return;
46+
47+	shell_for_each_layer(shell, handle_output_resize_layer, view->output);
48 }
49
50 static void
51--
522.20.1
53
54