@@ -1221,8 +1221,9 @@ void Pane::UpdateVisuals()
1221
1221
{
1222
1222
_UpdateBorders ();
1223
1223
}
1224
- _borderFirst.BorderBrush (_lastActive ? _themeResources.focusedBorderBrush : _themeResources.unfocusedBorderBrush );
1225
- _borderSecond.BorderBrush (_lastActive ? _themeResources.focusedBorderBrush : _themeResources.unfocusedBorderBrush );
1224
+ const auto & brush{ _ComputeBorderColor () };
1225
+ _borderFirst.BorderBrush (brush);
1226
+ _borderSecond.BorderBrush (brush);
1226
1227
}
1227
1228
1228
1229
// Method Description:
@@ -2963,3 +2964,79 @@ void Pane::CollectTaskbarStates(std::vector<winrt::TerminalApp::TaskbarState>& s
2963
2964
_secondChild->CollectTaskbarStates (states);
2964
2965
}
2965
2966
}
2967
+
2968
+ void Pane::EnableBroadcast (bool enabled)
2969
+ {
2970
+ if (_IsLeaf ())
2971
+ {
2972
+ _broadcastEnabled = enabled;
2973
+ UpdateVisuals ();
2974
+ }
2975
+ else
2976
+ {
2977
+ _firstChild->EnableBroadcast (enabled);
2978
+ _secondChild->EnableBroadcast (enabled);
2979
+ }
2980
+ }
2981
+
2982
+ void Pane::BroadcastKey (const winrt::Microsoft::Terminal::Control::TermControl& sourceControl,
2983
+ const WORD vkey,
2984
+ const WORD scanCode,
2985
+ const winrt::Microsoft::Terminal::Core::ControlKeyStates modifiers,
2986
+ const bool keyDown)
2987
+ {
2988
+ WalkTree ([&](const auto & pane) {
2989
+ if (const auto & termControl{ pane->GetTerminalControl () })
2990
+ {
2991
+ if (termControl != sourceControl && !termControl.ReadOnly ())
2992
+ {
2993
+ termControl.RawWriteKeyEvent (vkey, scanCode, modifiers, keyDown);
2994
+ }
2995
+ }
2996
+ });
2997
+ }
2998
+
2999
+ void Pane::BroadcastChar (const winrt::Microsoft::Terminal::Control::TermControl& sourceControl,
3000
+ const wchar_t character,
3001
+ const WORD scanCode,
3002
+ const winrt::Microsoft::Terminal::Core::ControlKeyStates modifiers)
3003
+ {
3004
+ WalkTree ([&](const auto & pane) {
3005
+ if (const auto & termControl{ pane->GetTerminalControl () })
3006
+ {
3007
+ if (termControl != sourceControl && !termControl.ReadOnly ())
3008
+ {
3009
+ termControl.RawWriteChar (character, scanCode, modifiers);
3010
+ }
3011
+ }
3012
+ });
3013
+ }
3014
+
3015
+ void Pane::BroadcastString (const winrt::Microsoft::Terminal::Control::TermControl& sourceControl,
3016
+ const winrt::hstring& text)
3017
+ {
3018
+ WalkTree ([&](const auto & pane) {
3019
+ if (const auto & termControl{ pane->GetTerminalControl () })
3020
+ {
3021
+ if (termControl != sourceControl && !termControl.ReadOnly ())
3022
+ {
3023
+ termControl.RawWriteString (text);
3024
+ }
3025
+ }
3026
+ });
3027
+ }
3028
+
3029
+ winrt::Windows::UI::Xaml::Media::SolidColorBrush Pane::_ComputeBorderColor ()
3030
+ {
3031
+ if (_lastActive)
3032
+ {
3033
+ return _themeResources.focusedBorderBrush ;
3034
+ }
3035
+
3036
+ if (_broadcastEnabled && (_IsLeaf () && !_content.ReadOnly ()))
3037
+ {
3038
+ return _themeResources.broadcastBorderBrush ;
3039
+ }
3040
+
3041
+ return _themeResources.unfocusedBorderBrush ;
3042
+ }
0 commit comments