From 7d903dea4a8af9e19fca1f56fb12e22fb58c9ef4 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 13 Feb 2023 17:13:59 -0600 Subject: [PATCH] [silmarillion] Fix moving a tab with panes. Now, the non-first panes don't rebuild themselves on move --- src/cascadia/TerminalApp/ContentManager.cpp | 3 ++- src/cascadia/TerminalApp/Pane.cpp | 2 +- src/cascadia/TerminalApp/TerminalTab.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cascadia/TerminalApp/ContentManager.cpp b/src/cascadia/TerminalApp/ContentManager.cpp index 19555c14e0f..d2c5707deb5 100644 --- a/src/cascadia/TerminalApp/ContentManager.cpp +++ b/src/cascadia/TerminalApp/ContentManager.cpp @@ -35,7 +35,8 @@ namespace winrt::TerminalApp::implementation { auto content = ControlInteractivity{ settings, unfocusedAppearance, connection }; content.Closed({ this, &ContentManager::_closedHandler }); - _content.Insert(content.Id(), content); + const auto& contentGuid{ content.Id() }; + _content.Insert(contentGuid, content); return content; } diff --git a/src/cascadia/TerminalApp/Pane.cpp b/src/cascadia/TerminalApp/Pane.cpp index 4086687ffe7..004de268d0f 100644 --- a/src/cascadia/TerminalApp/Pane.cpp +++ b/src/cascadia/TerminalApp/Pane.cpp @@ -180,7 +180,7 @@ NewTerminalArgs Pane::GetTerminalArgsForPane(const bool asContent) const Pane::BuildStartupState Pane::BuildStartupActions(uint32_t currentId, uint32_t nextId, const bool asContent) { // if we are a leaf then all there is to do is defer to the parent. - if (!asContent && _IsLeaf()) + if (_IsLeaf()) { if (_lastActive) { diff --git a/src/cascadia/TerminalApp/TerminalTab.cpp b/src/cascadia/TerminalApp/TerminalTab.cpp index 6ca9981c898..e05e5521eac 100644 --- a/src/cascadia/TerminalApp/TerminalTab.cpp +++ b/src/cascadia/TerminalApp/TerminalTab.cpp @@ -442,7 +442,7 @@ namespace winrt::TerminalApp::implementation { // Give initial ids (0 for the child created with this tab, // 1 for the child after the first split. - auto state = _rootPane->BuildStartupActions(0, 1); + auto state = _rootPane->BuildStartupActions(0, 1, asContent); { ActionAndArgs newTabAction{};