From 8705e65d8c535e54e0bd40daf53c0628b96d54b2 Mon Sep 17 00:00:00 2001 From: bucketbase26 Date: Sun, 6 Sep 2026 17:37:52 +0530 Subject: [PATCH] Dismiss the workspace menu when showing the delete confirmation The delete action lives on an attached context flyout, so choosing it does not close the parent workspace menu. The confirmation dialog is a separate popup and does not light-dismiss that menu either, which left it sitting over the dialog. Close both flyouts before ShowDialog so the confirmation is the only thing on screen. Closes #20636 --- src/cascadia/TerminalApp/TerminalPage.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 6a65c342e48..4590f2a8e0a 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -5796,13 +5796,24 @@ namespace winrt::TerminalApp::implementation auto trashIcon = UI::IconPathConverter::IconWUX(L"\xE74D"); // Delete glyph - deleteItem.Click([weakThis{ get_weak() }, name](auto&&, auto&&) -> safe_void_coroutine { + deleteItem.Click([weakThis{ get_weak() }, name, deleteFlyout](auto&&, auto&&) -> safe_void_coroutine { auto page{ weakThis.get() }; if (!page) { co_return; } + // The delete item lives in an attached context flyout, so + // clicking it does not dismiss the parent workspace menu. + // ContentDialog is a separate popup and will not light- + // dismiss that menu either, which leaves it sitting over + // the confirmation (GH#20636). Close both first. + deleteFlyout.Hide(); + if (page->_workspaceFlyout) + { + page->_workspaceFlyout.Hide(); + } + // Build and show a confirmation ContentDialog. ContentDialog dialog{}; dialog.Title(winrt::box_value(winrt::hstring{ RS_fmt(L"ConfirmDeleteWorkspaceTitle", name) }));