From 1fe16f42ea184ec971a9f75f321eb9171bfbd89c Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 16 Jul 2024 15:14:18 -0600 Subject: [PATCH] Fix context in command palette from application menu (#14599) Supercedes #14468 Release Notes: - linux: Fixed the command palette when opened from the application menu --- crates/title_bar/src/application_menu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/title_bar/src/application_menu.rs b/crates/title_bar/src/application_menu.rs index 44d8f8b53c..09ad4fe9d1 100644 --- a/crates/title_bar/src/application_menu.rs +++ b/crates/title_bar/src/application_menu.rs @@ -13,9 +13,10 @@ impl RenderOnce for ApplicationMenu { fn render(self, _cx: &mut WindowContext) -> impl IntoElement { PopoverMenu::new("application-menu") .menu(move |cx| { - ContextMenu::build(cx, move |menu, _cx| { + ContextMenu::build(cx, move |menu, cx| { menu.header("Workspace") .action("Open Command Palette", Box::new(command_palette::Toggle)) + .when_some(cx.focused(), |menu, focused| menu.context(focused)) .custom_row(move |cx| { h_flex() .gap_2()