git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitc27084859d4cc555a70ea43e1fae9c03c58b6161
parent3baaa9d5b0
authorIsaac Freund <[email protected]>
date2025-12-02 11:33
layer-shell: fix clip box, clarify protocol

 protocol/river-layer-shell-v1.xml | 3 +++
 river/LayerShellOutput.zig        | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/protocol/river-layer-shell-v1.xml b/protocol/river-layer-shell-v1.xml
index 8959131..f7756d3 100644
--- a/protocol/river-layer-shell-v1.xml
+++ b/protocol/river-layer-shell-v1.xml
@@ -95,6 +95,9 @@
         the exclusive zones of layer surfaces. Exclusive zones are a hint, the
         window manager is free to ignore this area hint if it wishes.
 
+        The x and y values are in the global coordinate space, not relative to
+        the position of the output.
+
         This event will be followed by a manage_start event after all other new
         state has been sent by the server.
       </description>
diff --git a/river/LayerShellOutput.zig b/river/LayerShellOutput.zig
index a0dbf84..595602c 100644
--- a/river/LayerShellOutput.zig
+++ b/river/LayerShellOutput.zig
@@ -152,8 +152,8 @@ fn sendConfigures(
             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,
+                .x = -(x - output.scheduled.x),
+                .y = -(y - output.scheduled.y),
                 .width = output_width,
                 .height = output_height,
             });