From 06ac1189d090307fbe1bc8a6846f69feda0294c7 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Wed, 8 May 2024 13:00:23 +0200 Subject: [PATCH] layer-shell: send configure event when output size changes --- src/ifs/wl_surface/zwlr_layer_surface_v1.rs | 7 ++++++- src/tree/output.rs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs index 635770e0..e2e274f3 100644 --- a/src/ifs/wl_surface/zwlr_layer_surface_v1.rs +++ b/src/ifs/wl_surface/zwlr_layer_surface_v1.rs @@ -292,7 +292,7 @@ impl ZwlrLayerSurfaceV1 { self.pos.get() } - pub fn compute_position(&self) { + fn compute_position(&self) { let Some(global) = self.output.get() else { return; }; @@ -326,6 +326,11 @@ impl ZwlrLayerSurfaceV1 { self.client.state.tree_changed(); } + pub fn output_resized(&self) { + self.configure(); + self.compute_position(); + } + pub fn destroy_node(&self) { self.link.set(None); self.mapped.set(false); diff --git a/src/tree/output.rs b/src/tree/output.rs index 21df694c..0aabc9f4 100644 --- a/src/tree/output.rs +++ b/src/tree/output.rs @@ -558,7 +558,7 @@ impl OutputNode { } for layer in &self.layers { for surface in layer.iter() { - surface.compute_position(); + surface.output_resized(); } } self.global.send_mode();