fix: window share not catch shield client

This commit is contained in:
DreamMaoMao 2026-06-19 15:26:47 +08:00
parent 3bffcda833
commit 9c6bcdc71f
2 changed files with 9 additions and 2 deletions

View file

@ -274,6 +274,11 @@ void buffer_set_effect(Client *c, BufferData data) {
} }
void apply_shield(Client *c, struct wlr_box clip_box) { 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) { if (active_capture_count > 0 && c->shield_when_capture) {
wlr_scene_node_raise_to_top(&c->shield->node); wlr_scene_node_raise_to_top(&c->shield->node);
wlr_scene_node_set_position(&c->shield->node, clip_box.x, clip_box.y); 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); offset = clip_to_hide(c, &clip_box);
apply_border(c); apply_border(c);
apply_shield(c, clip_box);
if (clip_box.width <= 0 || clip_box.height <= 0) { if (clip_box.width <= 0 || clip_box.height <= 0) {
return; return;
} }
apply_shield(c, clip_box);
if (!c->overview_scene_surface) { if (!c->overview_scene_surface) {
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node,
&clip_box); &clip_box);

View file

@ -4892,6 +4892,9 @@ handle_new_foreign_toplevel_capture_request(struct wl_listener *listener,
*request = data; *request = data;
Client *c = request->toplevel_handle->data; Client *c = request->toplevel_handle->data;
if (c->shield_when_capture)
return;
if (c->image_capture_source == NULL) { if (c->image_capture_source == NULL) {
c->image_capture_source = c->image_capture_source =
wlr_ext_image_capture_source_v1_create_with_scene_node( wlr_ext_image_capture_source_v1_create_with_scene_node(