From 1b5dd21ee610b30d13c9165dfde23989c5e97e8d Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 24 Oct 2024 12:05:48 +0200 Subject: [PATCH] layer-surface: fix clip box coordinates The clip box must be relative to the layer surface, not the output. --- river/Output.zig | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/river/Output.zig b/river/Output.zig index 9a5b94e..d4490c3 100644 --- a/river/Output.zig +++ b/river/Output.zig @@ -393,11 +393,15 @@ fn sendLayerConfigures( usable_box.* = new_usable_box; } - layer_surface.popup_tree.node.setPosition( - layer_surface.scene_layer_surface.tree.node.x, - layer_surface.scene_layer_surface.tree.node.y, - ); - layer_surface.scene_layer_surface.tree.node.subsurfaceTreeSetClip(&full_box); + const x = layer_surface.scene_layer_surface.tree.node.x; + const y = layer_surface.scene_layer_surface.tree.node.y; + layer_surface.popup_tree.node.setPosition(x, y); + layer_surface.scene_layer_surface.tree.node.subsurfaceTreeSetClip(&.{ + .x = -x, + .y = -y, + .width = full_box.width, + .height = full_box.height, + }); } } }