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)
697697 // Refocus the last pane if there was a pane focused
698698 if (const auto focus = first->GetActivePane ())
699699 {
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+ }
701707 }
702708
703709 if (const auto focus = second->GetActivePane ())
704710 {
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+ }
706718 }
707719
708720 return true ;
You can’t perform that action at this time.
0 commit comments