mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 13:56:33 -06:00
Manually focus panes after swapping them (#19024)
(cherry picked from commit bd7e3179ff1c41e9147d99253a9ab150cf9e942a) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgbeR18 Service-Version: 1.22
This commit is contained in:
parent
65d3a281c2
commit
fa8520e581
@ -697,12 +697,24 @@ bool Pane::SwapPanes(std::shared_ptr<Pane> first, std::shared_ptr<Pane> second)
|
|||||||
// Refocus the last pane if there was a pane focused
|
// Refocus the last pane if there was a pane focused
|
||||||
if (const auto focus = first->GetActivePane())
|
if (const auto focus = first->GetActivePane())
|
||||||
{
|
{
|
||||||
focus->_Focus();
|
// GH#18184: manually focus the pane and content.
|
||||||
|
// _Focus() results in no-op because the pane was _lastActive
|
||||||
|
focus->GotFocus.raise(focus, FocusState::Programmatic);
|
||||||
|
if (const auto& lastContent{ focus->GetLastFocusedContent() })
|
||||||
|
{
|
||||||
|
lastContent.Focus(FocusState::Programmatic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const auto focus = second->GetActivePane())
|
if (const auto focus = second->GetActivePane())
|
||||||
{
|
{
|
||||||
focus->_Focus();
|
// GH#18184: manually focus the pane and content.
|
||||||
|
// _Focus() results in no-op because the pane was _lastActive
|
||||||
|
focus->GotFocus.raise(focus, FocusState::Programmatic);
|
||||||
|
if (const auto& lastContent{ focus->GetLastFocusedContent() })
|
||||||
|
{
|
||||||
|
lastContent.Focus(FocusState::Programmatic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user