summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2025-01-14 11:16:03 +0000
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2025-01-14 11:18:08 +0000
commit8b3b554de2b9853a922b285082a0d1ca6f864ddb (patch)
tree2a592d07cd1ff33afdd94e1c46cfcf3423ceaa0b /winit
parent2086fc0d6b48bc3c8237d0bbdeac6d2d010ca7ae (diff)
downloadiced-8b3b554de2b9853a922b285082a0d1ca6f864ddb.tar.gz
iced-8b3b554de2b9853a922b285082a0d1ca6f864ddb.tar.bz2
iced-8b3b554de2b9853a922b285082a0d1ca6f864ddb.zip
Panic instead of erroring when compositor channel unexpectedly closes
Diffstat (limited to 'winit')
-rw-r--r--winit/src/program.rs17
1 files changed, 5 insertions, 12 deletions
diff --git a/winit/src/program.rs b/winit/src/program.rs
index 653d10bb..0f1ea042 100644
--- a/winit/src/program.rs
+++ b/winit/src/program.rs
@@ -586,13 +586,13 @@ async fn run_instance<P, C>(
let compositor_receiver =
compositor_receiver.take().expect("Waiting for compositor");
- match compositor_receiver.await.ok() {
- Some(Ok((new_compositor, event))) => {
+ match compositor_receiver.await {
+ Ok(Ok((new_compositor, event))) => {
compositor = Some(new_compositor);
Some(event)
}
- Some(Err(error)) => {
+ Ok(Err(error)) => {
control_sender
.start_send(Control::Crash(
Error::GraphicsCreationFailed(error),
@@ -600,15 +600,8 @@ async fn run_instance<P, C>(
.expect("Send control action");
break;
}
- None => {
- control_sender
- .start_send(Control::Crash(
- Error::GraphicsCreationFailed(
- graphics::Error::NoAvailablePixelFormat,
- ),
- ))
- .expect("Send control action");
- break;
+ Err(error) => {
+ panic!("Compositor initialization failed: {error}")
}
}
// Empty the queue if possible