diff --git a/src/desktop/space/mod.rs b/src/desktop/space/mod.rs index 0565bf1..47116b4 100644 --- a/src/desktop/space/mod.rs +++ b/src/desktop/space/mod.rs @@ -193,11 +193,17 @@ impl Space { /// The scale is the what is rendered for the given output /// and may be fractional. It is independent from the integer scale /// reported to clients by the output. + /// + /// *Note:* Remapping an output does reset it's damage memory. pub fn map_output>>(&mut self, output: &Output, scale: f64, location: P) { let mut state = output_state(self.id, output); *state = OutputState { location: location.into(), render_scale: scale, + // keep surfaces, we still need to inform them of leaving, + // if they don't overlap anymore during refresh. + surfaces: state.surfaces.drain(..).collect::>(), + // resets last_seen and old_damage, if remapped ..Default::default() }; if !self.outputs.contains(output) { @@ -289,8 +295,9 @@ impl Space { outputs } - /// Refresh some internal values and update client state - /// based on the position of windows and outputs. + /// Refresh some internal values and update client state, + /// meaning this will handle output enter and leave events + /// for mapped outputs and windows based on their position. /// /// Needs to be called periodically, at best before every /// wayland socket flush.