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 {
174 self.niri.layer_shell_on_demand_focus = Some(layer.clone());174 self.niri.layer_shell_on_demand_focus = Some(layer.clone());
175 }175 }
176 } else {176 } else {
177- self.niri.mapped_layer_surfaces.remove(layer);177+ let was_mapped = self.niri.mapped_layer_surfaces.remove(layer).is_some();
178 self.niri.unmapped_layer_surfaces.insert(surface.clone());178 self.niri.unmapped_layer_surfaces.insert(surface.clone());
179 179
180 // After layer surface unmaps it has to perform the initial commit-configure180 // After layer surface unmaps it has to perform the initial commit-configure
181 // sequence again. This is a workaround until Smithay properly resets181 // sequence again. This is a workaround until Smithay properly resets
182 // initial_configure_sent upon the surface unmapping itself as it does for182 // initial_configure_sent upon the surface unmapping itself as it does for
183 // toplevels.183 // toplevels.
184- with_states(surface, |states| {184+ if was_mapped {
185- let mut data = states185+ with_states(surface, |states| {
186- .data_map186+ let mut data = states
187- .get::<LayerSurfaceData>()187+ .data_map
188- .unwrap()188+ .get::<LayerSurfaceData>()
189- .lock()189+ .unwrap()
190- .unwrap();190+ .lock()
191- data.initial_configure_sent = false;191+ .unwrap();
192- });192+ data.initial_configure_sent = false;
193+ });
194+ }
193 }195 }
194 } else {196 } else {
195 let scale = output.current_scale();197 let scale = output.current_scale();