aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralex-huff <alexhuff@bakahuff.com>2025-05-22 09:49:51 -0500
committerIvan Molodetskikh <yalterz@gmail.com>2025-05-22 08:02:56 -0700
commit51a176ec4adfc0d94056d6739add873b4d2d6d9b (patch)
treed390f2941ea7121dc3126d30985ffd63c164aa2c /src
parentd618daf6b9994f8a0a2ff67531fa3ec72af9a122 (diff)
downloadniri-51a176ec4adfc0d94056d6739add873b4d2d6d9b.tar.gz
niri-51a176ec4adfc0d94056d6739add873b4d2d6d9b.tar.bz2
niri-51a176ec4adfc0d94056d6739add873b4d2d6d9b.zip
layer-shell: only reset 'initial_configure_sent' for mapped surfaces
Diffstat (limited to 'src')
-rw-r--r--src/handlers/layer_shell.rs22
1 files changed, 12 insertions, 10 deletions
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::<LayerSurfaceData>()
- .unwrap()
- .lock()
- .unwrap();
- data.initial_configure_sent = false;
- });
+ if was_mapped {
+ with_states(surface, |states| {
+ let mut data = states
+ .data_map
+ .get::<LayerSurfaceData>()
+ .unwrap()
+ .lock()
+ .unwrap();
+ data.initial_configure_sent = false;
+ });
+ }
}
} else {
let scale = output.current_scale();