Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

At sign-in the dock is started first, before the app prepares itself; one timing line per start

gelenmedyac116949d31c7
diff --git a/crates/rf-app/src/dock/control.rs b/crates/rf-app/src/dock/control.rs
index 15a5c525..7ef8157c 100644
--- a/crates/rf-app/src/dock/control.rs
+++ b/crates/rf-app/src/dock/control.rs
@@ -251,8 +251,9 @@ pub fn sync_process(s: &Settings) {
}
let _one_at_a_time = BUSY.lock().unwrap_or_else(|p| p.into_inner());
let mut running = is_running();
- if !running && !s.dock_enabled {
- // switched off while the process this rustyfiles started is still coming up: wait for its pipe, then stop it
+ if !running {
+ // A process this rustyfiles started is still coming up and has no pipe yet. Switched off meanwhile: wait for its pipe, then
+ // stop it. Still wanted (the start at sign-in starts the dock first, `start_early`): wait too, or a second dock is started.
let started = TOLD.lock().unwrap_or_else(|p| p.into_inner()).started;
if may_still_be_starting(started, Instant::now()) {
running = wait_until_running(started);
@@ -338,6 +339,33 @@ pub fn stop_now() -> bool {
rf_win::single_instance::send_to(APP, "stop")
}
+/// The start at sign-in, before the app prepares anything of its own: the dock is started first, when the setting is on and none
+/// runs. Until 1.0.10 the dock was started where the app's own start-up was done (`start_if_wanted`), after its window system and
+/// its graphics device: in the log of a sign-in (2026-12-03) the app's first line was at 16:23:41.9 and the dock's at 16:23:43.6,
+/// with Explorer up since 16:23:38 and the bottom of the screen empty all that time. Costs the read of the settings file, one look
+/// for the dock's pipe and one process start; blocks for none of them longer than a moment. Returns whether a dock was started here.
+pub fn start_early(s: &Settings) -> bool {
+ if !s.dock_enabled || crate::background::side_process() || disabled_by_environment() {
+ return false;
+ }
+ let _one_at_a_time = BUSY.lock().unwrap_or_else(|p| p.into_inner());
+ if is_running() {
+ return false;
+ }
+ match start_process() {
+ Ok(()) => {
+ let mut told = TOLD.lock().unwrap_or_else(|p| p.into_inner());
+ told.started = Some(Instant::now());
+ told.keys = Some(Keys::of(s));
+ true
+ }
+ Err(e) => {
+ log::warn!("dock: cannot start at sign-in: {e}");
+ false
+ }
+ }
+}
+
/// At the start of the main rustyfiles: starts the dock when the setting is on (off the UI thread).
pub fn start_if_wanted(s: &Settings) {
if !s.dock_enabled || crate::background::side_process() || disabled_by_environment() {
diff --git a/crates/rf-app/src/dock/host.rs b/crates/rf-app/src/dock/host.rs
index 9c83b716..6b6dc0b9 100644
--- a/crates/rf-app/src/dock/host.rs
+++ b/crates/rf-app/src/dock/host.rs
@@ -2007,6 +2007,13 @@ pub fn run(messages: Option<UnboundedReceiver<String>>, cx: &mut App) {
cx.quit();
return;
}
+ // (one line per start, for reading a slow sign-in from the log: see `dock::control::start_early`)
+ log::info!(
+ target: "rustyfiles::start",
+ "dock: its islands were opened {} ms after its process was created{}",
+ rf_win::process_age_ms(),
+ rf_win::explorer_age_ms().map_or(String::new(), |ms| format!(", {ms} ms after Explorer's"))
+ );
let panel_left = home.left.clone();
let sys_right = home.right.clone();
let tray_right = home.right.clone();
diff --git a/crates/rf-app/src/lib.rs b/crates/rf-app/src/lib.rs
index cfdb3940..f1c7f079 100644
--- a/crates/rf-app/src/lib.rs
+++ b/crates/rf-app/src/lib.rs
@@ -660,7 +660,7 @@ pub fn main() {
rf_win::thumbs::keep_gdiplus_alive();
// Logs go to stderr and to rustyfiles.log in the settings folder; override the level with
// RUST_LOG. The hybrid renderer (gpui_windows) logs its GPU/CPU switches at info level.
- env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn,gpui_windows=info"))
+ env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn,gpui_windows=info,rustyfiles::start=info"))
.target(env_logger::Target::Pipe(Box::new(logfile::Tee::new())))
.format_timestamp_millis()
.init();
@@ -670,6 +670,21 @@ pub fn main() {
update_splash::run();
return;
}
+ // The start at sign-in: the dock first, before anything of the app's own is prepared (see `dock::control::start_early`). One
+ // line in the log says how long after Explorer this process came, so that a slow sign-in can be read from the log afterwards.
+ // Not for a test copy that runs beside the real app.
+ if std::env::args().nth(1).as_deref() == Some(background::START_ARG) && std::env::var_os("RUSTYFILES_MULTI_INSTANCE").is_none() {
+ let age = rf_win::process_age_ms();
+ let started = dock::control::start_early(&settings::Settings::load());
+ let after_explorer = rf_win::explorer_age_ms().map(|e| e.saturating_sub(rf_win::process_age_ms()));
+ log::info!(
+ target: "rustyfiles::start",
+ "sign-in start: this process was created {} after Explorer's and reached this line {age} ms later; the dock was {} at {} ms",
+ after_explorer.map_or("an unknown time".to_string(), |ms| format!("{ms} ms")),
+ if started { "started" } else { "not started here (off, running already, or a side process)" },
+ rf_win::process_age_ms()
+ );
+ }
// As default file manager we also receive shell namespaces (Control Panel = "::{…}") and
// non-folders: hand those back to Explorer so nothing becomes unreachable.
diff --git a/crates/rf-win/src/lib.rs b/crates/rf-win/src/lib.rs
index 31f779bc..489635ad 100644
--- a/crates/rf-win/src/lib.rs
+++ b/crates/rf-win/src/lib.rs
@@ -149,6 +149,17 @@ pub use drives::{Drive, DriveKind, list_drives};
pub use known::{KnownFolder, known_folders};
pub use listing::{ListError, list_dir, stat_entry};
+/// Milliseconds since Explorer's process was created (the one whose taskbar it is). `None` without an Explorer taskbar. For the
+/// start-up timing at sign-in: Explorer is the first thing of the desktop Windows starts, so this is "how long after the sign-in".
+pub fn explorer_age_ms() -> Option<u64> {
+ use windows::Win32::System::SystemInformation::GetSystemTimePreciseAsFileTime;
+ let live = rf_shellguard::win::tbwin::list_taskbar_windows().ok()?;
+ let start = live.iter().find(|w| w.class == rf_shellguard::tbmodel::PRIMARY && w.explorer && w.start != 0)?.start;
+ let now = unsafe { GetSystemTimePreciseAsFileTime() };
+ let now = ((now.dwHighDateTime as u64) << 32) | now.dwLowDateTime as u64;
+ Some(now.saturating_sub(start) / 10_000)
+}
+
/// Milliseconds since this process was created (start-up timing).
pub fn process_age_ms() -> u64 {
use windows::Win32::Foundation::FILETIME;