File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,13 +35,19 @@ namespace winrt::TerminalApp::implementation
3535 ContentRoot ().Children ().Append (content);
3636 }
3737
38- void TitlebarControl::Root_SizeChanged (const IInspectable& sender, Windows::UI ::Xaml::SizeChangedEventArgs const & e)
38+ void TitlebarControl::Root_SizeChanged (const IInspectable& sender,
39+ const Windows::UI ::Xaml::SizeChangedEventArgs& e)
3940 {
4041 const auto windowWidth = ActualWidth ();
4142 const auto minMaxCloseWidth = MinMaxCloseControl ().ActualWidth ();
4243 const auto dragBarMinWidth = DragBar ().MinWidth ();
4344 const auto maxWidth = windowWidth - minMaxCloseWidth - dragBarMinWidth;
44- ContentRoot ().MaxWidth (maxWidth);
45+ // Only set our MaxWidth if it's greater than 0. Setting it to a
46+ // negative value will cause a crash.
47+ if (maxWidth >= 0 )
48+ {
49+ ContentRoot ().MaxWidth (maxWidth);
50+ }
4551 }
4652
4753 void TitlebarControl::_OnMaximizeOrRestore (byte flag)
You can’t perform that action at this time.
0 commit comments