mirror of
https://github.com/microsoft/terminal.git
synced 2026-07-08 18:16:28 +00:00
Fix wt -w _quake by not throwing when setting the window name (#15030)
If we get initialized with a window name, this will be called before XAML is stood up, and constructing a PropertyChangedEventArgs will throw. So don't. Regressed in #14843 Related to #5000, #14957
This commit is contained in:
@@ -1155,6 +1155,10 @@ namespace winrt::TerminalApp::implementation
|
||||
{
|
||||
const auto oldIsQuakeMode = _WindowProperties->IsQuakeWindow();
|
||||
_WindowProperties->WindowName(name);
|
||||
if (!_root)
|
||||
{
|
||||
return;
|
||||
}
|
||||
const auto newIsQuakeMode = _WindowProperties->IsQuakeWindow();
|
||||
if (newIsQuakeMode != oldIsQuakeMode)
|
||||
{
|
||||
@@ -1210,8 +1214,15 @@ namespace winrt::TerminalApp::implementation
|
||||
if (_WindowName != value)
|
||||
{
|
||||
_WindowName = value;
|
||||
_PropertyChangedHandlers(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"WindowName" });
|
||||
_PropertyChangedHandlers(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"WindowNameForDisplay" });
|
||||
// If we get initialized with a window name, this will be called
|
||||
// before XAML is stood up, and constructing a
|
||||
// PropertyChangedEventArgs will throw.
|
||||
try
|
||||
{
|
||||
_PropertyChangedHandlers(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"WindowName" });
|
||||
_PropertyChangedHandlers(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"WindowNameForDisplay" });
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
}
|
||||
uint64_t WindowProperties::WindowId() const noexcept
|
||||
|
||||
Reference in New Issue
Block a user