File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -697,12 +697,24 @@ bool Pane::SwapPanes(std::shared_ptr<Pane> first, std::shared_ptr<Pane> second)
697
697
// Refocus the last pane if there was a pane focused
698
698
if (const auto focus = first->GetActivePane ())
699
699
{
700
- focus->_Focus ();
700
+ // GH#18184: manually focus the pane and content.
701
+ // _Focus() results in no-op because the pane was _lastActive
702
+ focus->GotFocus .raise (focus, FocusState::Programmatic);
703
+ if (const auto & lastContent{ focus->GetLastFocusedContent () })
704
+ {
705
+ lastContent.Focus (FocusState::Programmatic);
706
+ }
701
707
}
702
708
703
709
if (const auto focus = second->GetActivePane ())
704
710
{
705
- focus->_Focus ();
711
+ // GH#18184: manually focus the pane and content.
712
+ // _Focus() results in no-op because the pane was _lastActive
713
+ focus->GotFocus .raise (focus, FocusState::Programmatic);
714
+ if (const auto & lastContent{ focus->GetLastFocusedContent () })
715
+ {
716
+ lastContent.Focus (FocusState::Programmatic);
717
+ }
706
718
}
707
719
708
720
return true ;
You can’t perform that action at this time.
0 commit comments