Add log message on first render (#40749)

Having this in our logs with a timestamp should help when users submit
issues with logs about slow startup time.

Release Notes:

- N/A
This commit is contained in:
Julia Ryan
2025-10-21 00:17:26 -07:00
committed by GitHub
parent a56122e144
commit ea6e6dbda1

View File

@@ -102,7 +102,10 @@ use std::{
path::{Path, PathBuf},
process::ExitStatus,
rc::Rc,
sync::{Arc, LazyLock, Weak, atomic::AtomicUsize},
sync::{
Arc, LazyLock, Weak,
atomic::{AtomicBool, AtomicUsize},
},
time::Duration,
};
use task::{DebugScenario, SpawnInTerminal, TaskContext};
@@ -6358,6 +6361,10 @@ impl Render for DraggedDock {
impl Render for Workspace {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
static FIRST_PAINT: AtomicBool = AtomicBool::new(true);
if FIRST_PAINT.swap(false, std::sync::atomic::Ordering::Relaxed) {
log::info!("Rendered first frame");
}
let mut context = KeyContext::new_with_defaults();
context.add("Workspace");
context.set("keyboard_layout", cx.keyboard_layout().name().to_string());