Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix requiring requiring focus for shutdown via ctrl+c when starting viewer from command line #1646

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/rerun/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,14 @@ async fn run_impl(
} else {
#[cfg(feature = "native_viewer")]
return re_viewer::run_native_app(Box::new(move |cc, re_ui| {
// We need to wake up the ui thread in order to process shutdown signals.
let ctx = cc.egui_ctx.clone();
let mut shutdown_repaint = shutdown_rx.resubscribe();
tokio::spawn(async move {
shutdown_repaint.recv().await.unwrap();
ctx.request_repaint();
});

let rx = re_viewer::wake_up_ui_thread_on_each_msg(rx, cc.egui_ctx.clone());
let mut app = re_viewer::App::from_receiver(
_build_info,
Expand Down