From 2b4173f10bf9989a74ffa184a4a05a783424d705 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 20 Apr 2024 21:01:36 +0200 Subject: [PATCH] tree: fix positioning of layer-shell surfaces --- src/ifs/wl_surface/zwlr_layer_surface_v1.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs index ed231aa9..c47de002 100644 --- a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs +++ b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs @@ -322,10 +322,11 @@ impl ZwlrLayerSurfaceV1 { } else if anchor.contains(BOTTOM) { y1 += opos.height() - height; } - let rect = Rect::new_sized(x1, y1, width, height).unwrap(); - self.output_pos.set(rect); - self.pos.set(rect.move_(opos.x1(), opos.y1())); - self.surface.set_absolute_position(x1, y1); + let o_rect = Rect::new_sized(x1, y1, width, height).unwrap(); + let a_rect = o_rect.move_(opos.x1(), opos.y1()); + self.output_pos.set(o_rect); + self.pos.set(a_rect); + self.surface.set_absolute_position(a_rect.x1(), a_rect.y1()); self.client.state.tree_changed(); }