From 9c6bcdc71f1f1e721f2c15d9e683a817fcbc6941 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Fri, 19 Jun 2026 15:26:47 +0800 Subject: [PATCH] fix: window share not catch shield client --- src/animation/client.h | 8 ++++++-- src/mango.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/animation/client.h b/src/animation/client.h index 832caa0b..6b295462 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -274,6 +274,11 @@ void buffer_set_effect(Client *c, BufferData data) { } void apply_shield(Client *c, struct wlr_box clip_box) { + + if (clip_box.width <= 0 || clip_box.height <= 0) { + return; + } + if (active_capture_count > 0 && c->shield_when_capture) { wlr_scene_node_raise_to_top(&c->shield->node); wlr_scene_node_set_position(&c->shield->node, clip_box.x, clip_box.y); @@ -781,13 +786,12 @@ void client_apply_clip(Client *c, float factor) { offset = clip_to_hide(c, &clip_box); apply_border(c); + apply_shield(c, clip_box); if (clip_box.width <= 0 || clip_box.height <= 0) { return; } - apply_shield(c, clip_box); - if (!c->overview_scene_surface) { wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip_box); diff --git a/src/mango.c b/src/mango.c index badbe0e5..3c03c919 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4892,6 +4892,9 @@ handle_new_foreign_toplevel_capture_request(struct wl_listener *listener, *request = data; Client *c = request->toplevel_handle->data; + if (c->shield_when_capture) + return; + if (c->image_capture_source == NULL) { c->image_capture_source = wlr_ext_image_capture_source_v1_create_with_scene_node(