Skip to content

Commit c7cb3ce

Browse files
committed
More things we might need for Non-Terminal content, #997
1 parent b4fd3f3 commit c7cb3ce

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/cascadia/TerminalApp/Pane.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3009,6 +3009,15 @@ void Pane::_AdvanceSnappedDimension(const bool widthOrHeight, LayoutSizeNode& si
30093009
sizeNode.size += widthOrHeight ? cellSize.Width : cellSize.Height;
30103010
}
30113011
}
3012+
else if (_IsLeaf())
3013+
{
3014+
// If we're a leaf that didn't have a TermControl, then just increment
3015+
// by one. We have to increment by _some_ value, because this is used in
3016+
// a while() loop to find the next bigger size we can snap to. But since
3017+
// a non-terminal control doesn't really care what size it's snapped to,
3018+
// we can just say "one pixel larger is the next snap point"
3019+
sizeNode.size += 1;
3020+
}
30123021
else if (!_IsLeaf())
30133022
{
30143023
// We're a parent pane, so we have to advance dimension of our children panes. In
@@ -3299,7 +3308,9 @@ std::optional<SplitDirection> Pane::PreCalculateAutoSplit(const std::shared_ptr<
32993308
bool Pane::ContainsReadOnly() const
33003309
{
33013310
const auto& termControl{ GetTerminalControl() };
3302-
return termControl ? termControl.ReadOnly() : (_firstChild->ContainsReadOnly() || _secondChild->ContainsReadOnly());
3311+
return termControl ?
3312+
termControl.ReadOnly() :
3313+
(_IsLeaf() ? false : (_firstChild->ContainsReadOnly() || _secondChild->ContainsReadOnly()));
33033314
}
33043315

33053316
// Method Description:

src/cascadia/TerminalApp/TerminalPage.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,10 @@ namespace winrt::TerminalApp::implementation
15951595
// the control here instead.
15961596
if (_startupState == StartupState::Initialized)
15971597
{
1598-
_GetActiveControl().Focus(FocusState::Programmatic);
1598+
if (const auto& activeControl{ _GetActiveControl() })
1599+
{
1600+
activeControl.Focus(FocusState::Programmatic);
1601+
}
15991602
}
16001603
}
16011604
CATCH_LOG();

0 commit comments

Comments
 (0)