Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) }));
Expand Down