1
0
Fork 0
forked from wry/wry

wayland: don't store direct output references

This commit is contained in:
Julian Orth 2024-04-25 19:38:19 +02:00
parent 0605438d56
commit 4651f760f0
13 changed files with 123 additions and 65 deletions

View file

@ -57,17 +57,17 @@ impl ZwlrLayerShellV1RequestHandler for ZwlrLayerShellV1 {
let surface = self.client.lookup(req.surface)?;
let output = 'get_output: {
if req.output.is_some() {
self.client.lookup(req.output)?.global.node.get().unwrap()
self.client.lookup(req.output)?.global.clone()
} else {
for seat in self.client.state.seat_queue.rev_iter() {
let output = seat.get_output();
if !output.is_dummy {
break 'get_output output;
break 'get_output output.global.opt.clone();
}
}
let outputs = self.client.state.outputs.lock();
if let Some(output) = outputs.values().next() {
break 'get_output output.node.clone();
break 'get_output output.node.global.opt.clone();
}
return Err(ZwlrLayerShellV1Error::NoOutputs);
}