From 51a176ec4adfc0d94056d6739add873b4d2d6d9b Mon Sep 17 00:00:00 2001 From: alex-huff Date: Thu, 22 May 2025 09:49:51 -0500 Subject: layer-shell: only reset 'initial_configure_sent' for mapped surfaces --- src/handlers/layer_shell.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/handlers/layer_shell.rs b/src/handlers/layer_shell.rs index c1b00c30..fd2c592f 100644 --- a/src/handlers/layer_shell.rs +++ b/src/handlers/layer_shell.rs @@ -174,22 +174,24 @@ impl State { self.niri.layer_shell_on_demand_focus = Some(layer.clone()); } } else { - self.niri.mapped_layer_surfaces.remove(layer); + let was_mapped = self.niri.mapped_layer_surfaces.remove(layer).is_some(); self.niri.unmapped_layer_surfaces.insert(surface.clone()); // After layer surface unmaps it has to perform the initial commit-configure // sequence again. This is a workaround until Smithay properly resets // initial_configure_sent upon the surface unmapping itself as it does for // toplevels. - with_states(surface, |states| { - let mut data = states - .data_map - .get::() - .unwrap() - .lock() - .unwrap(); - data.initial_configure_sent = false; - }); + if was_mapped { + with_states(surface, |states| { + let mut data = states + .data_map + .get::() + .unwrap() + .lock() + .unwrap(); + data.initial_configure_sent = false; + }); + } } } else { let scale = output.current_scale(); -- cgit