From 24297edfdaaf1ea6468ffc88e9acb705d9e50d0a Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Thu, 30 Jul 2026 16:22:08 -0700 Subject: [PATCH] Add close button to Studio plugin windows. Plugin windows could only be closed from the Plugins menu. Pass the plugin's active flag to ImGui::Begin so the window gets a close button that writes the same persisted state as the menu toggle. Skip the update callback while the window is collapsed. PiperOrigin-RevId: 956795070 Change-Id: I61cb5c26e7af935b6bb296f1b89142a72b0daca1 --- src/experimental/studio/app.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/experimental/studio/app.cc b/src/experimental/studio/app.cc index ae854020..e886e911 100644 --- a/src/experimental/studio/app.cc +++ b/src/experimental/studio/app.cc @@ -1167,8 +1167,9 @@ void App::BuildGui() { ImGui::EndMainMenuBar(); } if (plugin->active) { - ImGui::Begin(plugin->name); - plugin->update(plugin); + if (ImGui::Begin(plugin->name, &plugin->active)) { + plugin->update(plugin); + } ImGui::End(); } });