forge
Explore
Log in

Don't you dare go Hollow

layer-shell: only reset 'initial_configure_sent' for mapped surfaces

Browse files at this commit

51a176ec4adfc0d94056d6739add873b4d2d6d9balex-huffParent: d618daf
src/handlers/layer_shell.rsmodified+12 -10
@@ -174,22 +174,24 @@ impl State {
174174 self.niri.layer_shell_on_demand_focus = Some(layer.clone());
175175 }
176176 } else {
177- self.niri.mapped_layer_surfaces.remove(layer);
177+ let was_mapped = self.niri.mapped_layer_surfaces.remove(layer).is_some();
178178 self.niri.unmapped_layer_surfaces.insert(surface.clone());
179179
180180 // After layer surface unmaps it has to perform the initial commit-configure
181181 // sequence again. This is a workaround until Smithay properly resets
182182 // initial_configure_sent upon the surface unmapping itself as it does for
183183 // toplevels.
184- with_states(surface, |states| {
185- let mut data = states
186- .data_map
187- .get::<LayerSurfaceData>()
188- .unwrap()
189- .lock()
190- .unwrap();
191- data.initial_configure_sent = false;
192- });
184+ if was_mapped {
185+ with_states(surface, |states| {
186+ let mut data = states
187+ .data_map
188+ .get::<LayerSurfaceData>()
189+ .unwrap()
190+ .lock()
191+ .unwrap();
192+ data.initial_configure_sent = false;
193+ });
194+ }
193195 }
194196 } else {
195197 let scale = output.current_scale();