Skip to content

Commit

Permalink
This fixes #5750 specifically, but a little dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed May 6, 2021
1 parent f518235 commit 9ed5e8c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cascadia/TerminalApp/TabManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,21 @@ namespace winrt::TerminalApp::implementation
}
});

// TODO! Combine withthe below.
newTabImpl->TabRenamerDeactivated([weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
if (const auto page{ weakThis.get() })
{
page->_FocusCurrentTab(false);
}
});

newTabImpl->RequestFocusActiveControl([weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
if (const auto page{ weakThis.get() })
{
page->_FocusCurrentTab(false);
}
});

if (debugConnection) // this will only be set if global debugging is on and tap is active
{
auto newControl = _InitControl(settings, debugConnection);
Expand Down
6 changes: 6 additions & 0 deletions src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,12 @@ namespace winrt::TerminalApp::implementation
newTabFlyout.Items().Append(renameTabMenuItem);
newTabFlyout.Items().Append(duplicateTabMenuItem);
newTabFlyout.Items().Append(menuSeparator);
newTabFlyout.Closed([weakThis](auto&&, auto&&) {
if (auto tab{ weakThis.get() })
{
tab->_RequestFocusActiveControlHandlers(*tab, nullptr);
}
});
_AppendCloseMenuItems(newTabFlyout);
TabViewItem().ContextFlyout(newTabFlyout);
}
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/TerminalTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace winrt::TerminalApp::implementation
DECLARE_EVENT(DuplicateRequested, _DuplicateRequestedHandlers, winrt::delegate<>);
FORWARDED_TYPED_EVENT(TabRenamerDeactivated, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable, (&_headerControl), RenameEnded);
TYPED_EVENT(TaskbarProgressChanged, IInspectable, IInspectable);
TYPED_EVENT(RequestFocusActiveControl, IInspectable, IInspectable);

private:
std::shared_ptr<Pane> _rootPane{ nullptr };
Expand Down

0 comments on commit 9ed5e8c

Please sign in to comment.