From fa3f5d7204ae3571adb06ca620eb17a6a1b23333 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 18 Feb 2025 22:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=20=E4=BD=86=E6=98=AF=E6=8A=8A=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E9=87=8C=E9=9D=A2=E4=B8=8D=E5=BA=94=E8=AF=A5=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E7=9A=84buffer=E4=B9=9F=E7=BC=A9=E6=94=BE=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maomao.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/maomao.c b/maomao.c index bfb37d83..bc5cc933 100644 --- a/maomao.c +++ b/maomao.c @@ -544,6 +544,7 @@ void incohgaps(const Arg *arg); void incovgaps(const Arg *arg); void incigaps(const Arg *arg); void defaultgaps(const Arg *arg); +void buffer_set_size(Client *c, struct wlr_box box); #include "dispatch.h" @@ -773,13 +774,9 @@ bool client_animation_next_tick(Client *c) { } void client_actual_size(Client *c, uint32_t *width, uint32_t *height) { - *width = c->animation.running - ? MIN(c->animation.current.width, c->current.width) - : c->current.width; + *width = c->animation.current.width; - *height = c->animation.running - ? MIN(c->animation.current.height, c->current.height) - : c->current.height; + *height = c->animation.current.height; } void apply_border(Client *c, struct wlr_box clip_box, int offset) { @@ -865,6 +862,7 @@ void client_apply_clip(Client *c) { } } + buffer_set_size(c, clip_box); wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip_box); apply_border(c, clip_box, offset); } @@ -3611,6 +3609,16 @@ void scene_buffer_apply_opacity(struct wlr_scene_buffer *buffer, int sx, int sy, wlr_scene_buffer_set_opacity(buffer, *(double *)data); } +void scene_buffer_apply_size(struct wlr_scene_buffer *buffer, int sx, int sy, void *data) { + struct wlr_box *box = (struct wlr_box *)data; + wlr_scene_buffer_set_dest_size(buffer, box->width, box->height); +} + +void buffer_set_size(Client *c, struct wlr_box box) { + wlr_scene_node_for_each_buffer(&c->scene_surface->node, + scene_buffer_apply_size, &box); +} + void client_set_opacity(Client *c, double opacity) { wlr_scene_node_for_each_buffer(&c->scene_surface->node, scene_buffer_apply_opacity, &opacity);