From 7140070580458854029334b3ba963faef54be3cd Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 29 Dec 2025 18:33:37 +0800 Subject: [PATCH] fix: fix error offset for shadow and surface clip --- src/animation/client.h | 10 ++++------ src/client/client.h | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/animation/client.h b/src/animation/client.h index 34cc44a..16bcaa9 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -1,7 +1,7 @@ void client_actual_size(Client *c, uint32_t *width, uint32_t *height) { - *width = c->animation.current.width - c->bw; + *width = c->animation.current.width - 2 * c->bw; - *height = c->animation.current.height - c->bw; + *height = c->animation.current.height - 2 * c->bw; } void set_rect_size(struct wlr_scene_rect *rect, int width, int height) { @@ -394,8 +394,6 @@ void client_apply_clip(Client *c, float factor) { struct ivec2 offset; BufferData buffer_data; - int bw = (int)c->bw; - if (!animations) { c->animation.running = false; c->need_output_flush = false; @@ -429,8 +427,8 @@ void client_apply_clip(Client *c, float factor) { clip_box = (struct wlr_box){ .x = geometry.x, .y = geometry.y, - .width = width - bw, - .height = height - bw, + .width = width, + .height = height, }; if (client_is_x11(c)) { diff --git a/src/client/client.h b/src/client/client.h index 0425495..e0e36cc 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -127,8 +127,8 @@ static inline void client_get_clip(Client *c, struct wlr_box *clip) { *clip = (struct wlr_box){ .x = 0, .y = 0, - .width = c->geom.width - c->bw, - .height = c->geom.height - c->bw, + .width = c->geom.width - 2 * c->bw, + .height = c->geom.height - 2 * c->bw, }; #ifdef XWAYLAND