new/buildroot/package/weston/0046-desktop-shell-Resize-views-when-work-area-changed.patch
2025-05-10 21:58:58 +08:00

54 lines
1.6 KiB
Diff

From 5deac2606736a2bddbf7724f7019dc7b86276e21 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 46/93] 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 fb410ba..0110ac2 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;
@@ -2619,6 +2623,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;
@@ -2638,7 +2643,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