Skip to content

Commit

Permalink
Better error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 3, 2023
1 parent 75e6d3c commit 0df4b49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/eframe/src/native/epi_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ pub fn handle_app_output(
}

if drag_window {
let _ = window.drag_window();
window.drag_window().ok();
}

if let Some(always_on_top) = always_on_top {
Expand Down
18 changes: 13 additions & 5 deletions crates/eframe/src/native/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ mod glow_integration {
&output.textures_delta,
);
crate::profile_scope!("swap_buffers");
let _ = window
if let Err(err) = window
.gl_surface
.as_ref()
.expect("failed to get surface to swap buffers")
Expand All @@ -1229,7 +1229,10 @@ mod glow_integration {
.current_gl_context
.as_ref()
.expect("failed to get current context to swap buffers"),
);
)
{
log::error!("swap_buffers failed: {err}");
}
winit_state.handle_platform_output(&win, pair.this, egui_ctx, output.platform_output);
}

Expand Down Expand Up @@ -1545,7 +1548,7 @@ mod glow_integration {

{
crate::profile_scope!("swap_buffers");
let _ = viewport
if let Err(err) = viewport
.borrow()
.gl_surface
.as_ref()
Expand All @@ -1556,7 +1559,10 @@ mod glow_integration {
.current_gl_context
.as_ref()
.expect("failed to get current context to swap buffers"),
);
)
{
log::error!("swap_buffers failed: {err}");
}
}

integration.post_present(&viewport.borrow().window.as_ref().unwrap().borrow());
Expand Down Expand Up @@ -1693,7 +1699,9 @@ mod glow_integration {

winit::event::Event::MainEventsCleared => {
if let Some(running) = self.running.borrow().as_ref() {
let _ = running.glutin_ctx.borrow_mut().on_resume(event_loop);
if let Err(err) = running.glutin_ctx.borrow_mut().on_resume(event_loop) {
log::warn!("on_resume failed {err}");
}
}
EventResult::Wait
}
Expand Down

0 comments on commit 0df4b49

Please sign in to comment.