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
From 9a6c6b5a09605ca97363629709e46f36eb5bbea3 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Fri, 2 Apr 2021 01:50:22 +0800
Subject: [PATCH 43/74] desktop-shell: Resize views when work area changed
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 desktop-shell/shell.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 3b6ca7e..4a25734 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -48,6 +48,10 @@
 #define DEFAULT_NUM_WORKSPACES 1
 #define DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH 200
 
+static void
+handle_output_resize_layer(struct desktop_shell *shell,
+               struct weston_layer *layer, void *data);
+
 struct focus_state {
     struct desktop_shell *shell;
     struct weston_seat *seat;
@@ -3052,6 +3056,7 @@ panel_committed(struct weston_surface *es, int32_t sx, int32_t sy)
 {
     struct desktop_shell *shell = es->committed_private;
     struct weston_view *view;
+    pixman_rectangle32_t old_area, new_area;
     int width, height;
     int x = 0, y = 0;
 
@@ -3071,7 +3076,16 @@ panel_committed(struct weston_surface *es, int32_t sx, int32_t sy)
         break;
     }
 
+    get_output_work_area(shell, view->output, &old_area);
     configure_static_view(view, &shell->panel_layer, x, y);
+    get_output_work_area(shell, view->output, &new_area);
+
+    if (old_area.x == new_area.x && old_area.y == new_area.y &&
+        old_area.width == new_area.width &&
+        old_area.height == new_area.height)
+        return;
+
+    shell_for_each_layer(shell, handle_output_resize_layer, view->output);
 }
 
 static void
-- 
2.20.1