1
0
Fork 0
forked from wry/wry

tree: destroy layer shell surfaces when output is disconnected

This commit is contained in:
Julian Orth 2022-08-20 23:03:29 +02:00
parent ae991b9038
commit d67eefdaf0
2 changed files with 11 additions and 2 deletions

View file

@ -126,8 +126,7 @@ impl ZwlrLayerSurfaceV1 {
});
}
#[allow(dead_code)]
fn send_closed(&self) {
pub fn send_closed(&self) {
self.client.event(Closed { self_id: self.id });
}

View file

@ -228,6 +228,16 @@ impl ConnectorHandler {
self.data.connected.set(false);
self.state.outputs.remove(&self.id);
on.lock_surface.take();
{
let mut surfaces = vec!();
for layer in &on.layers {
surfaces.extend(layer.iter());
}
for surface in surfaces {
surface.destroy_node();
surface.send_closed();
}
}
let mut target_is_dummy = false;
let target = match self.state.outputs.lock().values().next() {
Some(o) => o.node.clone(),