Panic instead of erroring when compositor channel unexpectedly closes
This commit is contained in:
parent
2086fc0d6b
commit
8b3b554de2
1 changed files with 5 additions and 12 deletions
|
|
@ -586,13 +586,13 @@ async fn run_instance<P, C>(
|
||||||
let compositor_receiver =
|
let compositor_receiver =
|
||||||
compositor_receiver.take().expect("Waiting for compositor");
|
compositor_receiver.take().expect("Waiting for compositor");
|
||||||
|
|
||||||
match compositor_receiver.await.ok() {
|
match compositor_receiver.await {
|
||||||
Some(Ok((new_compositor, event))) => {
|
Ok(Ok((new_compositor, event))) => {
|
||||||
compositor = Some(new_compositor);
|
compositor = Some(new_compositor);
|
||||||
|
|
||||||
Some(event)
|
Some(event)
|
||||||
}
|
}
|
||||||
Some(Err(error)) => {
|
Ok(Err(error)) => {
|
||||||
control_sender
|
control_sender
|
||||||
.start_send(Control::Crash(
|
.start_send(Control::Crash(
|
||||||
Error::GraphicsCreationFailed(error),
|
Error::GraphicsCreationFailed(error),
|
||||||
|
|
@ -600,15 +600,8 @@ async fn run_instance<P, C>(
|
||||||
.expect("Send control action");
|
.expect("Send control action");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
None => {
|
Err(error) => {
|
||||||
control_sender
|
panic!("Compositor initialization failed: {error}")
|
||||||
.start_send(Control::Crash(
|
|
||||||
Error::GraphicsCreationFailed(
|
|
||||||
graphics::Error::NoAvailablePixelFormat,
|
|
||||||
),
|
|
||||||
))
|
|
||||||
.expect("Send control action");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Empty the queue if possible
|
// Empty the queue if possible
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue