From c61d239ac62218443ec2a191a8944637afe92349 Mon Sep 17 00:00:00 2001 From: Haroon Qureshi Date: Wed, 25 Mar 2026 05:52:39 -0700 Subject: [PATCH] Use model name for window title. PiperOrigin-RevId: 889193934 Change-Id: Ief9ade9e239c14da1d824d9bc8aa95dc0a71b65f --- src/experimental/studio/app.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/experimental/studio/app.cc b/src/experimental/studio/app.cc index eb4b29a8..7dadad45 100644 --- a/src/experimental/studio/app.cc +++ b/src/experimental/studio/app.cc @@ -166,7 +166,13 @@ void App::LoadModelFromFile(const std::string& filepath) { OnModelLoaded(filepath, kModelFromFile); spec_editor_.Reset(*spec()); UpdateFilePaths(resolved_file); - window_->SetTitle("MuJoCo Studio : " + filepath); + if (model() && model()->names) { + // Assumes the first string in the model is the name of the model itself. + window_->SetTitle("MuJoCo Studio : " + std::string(model()->names)); + } else { + window_->SetTitle("MuJoCo Studio : " + + std::filesystem::path(filepath).stem().string()); + } } else { SetLoadError(std::string(model_holder_->error())); }