diff --git a/src/cascadia/TerminalApp/Pane.cpp b/src/cascadia/TerminalApp/Pane.cpp index a9e77d38cfd..eb2c88c98a5 100644 --- a/src/cascadia/TerminalApp/Pane.cpp +++ b/src/cascadia/TerminalApp/Pane.cpp @@ -645,6 +645,10 @@ void Pane::UpdateSettings(const TerminalSettingsCreateResult& settings, const GU auto unfocusedSettings{ settings.UnfocusedSettings() }; if (unfocusedSettings) { + // Note: the unfocused settings needs to be entirely unchanged _except_ we need to + // set its parent to the settings object that lives in the control. This is because + // the overrides made by the control live in that settings object, so we want to make + // sure the unfocused settings inherit from that. unfocusedSettings.SetParent(_control.Settings().as()); } _control.UnfocusedAppearance(unfocusedSettings); diff --git a/src/cascadia/TerminalSettingsModel/Profile.cpp b/src/cascadia/TerminalSettingsModel/Profile.cpp index bc6914e1cec..a3fc5c6ae0b 100644 --- a/src/cascadia/TerminalSettingsModel/Profile.cpp +++ b/src/cascadia/TerminalSettingsModel/Profile.cpp @@ -180,13 +180,12 @@ void Profile::InsertParentHelper(winrt::com_ptr child, winrt::com_ptr

InsertParent(index.value(), parent); - child->_FinalizeInheritance(); } else { child->InsertParent(parent); - child->_FinalizeInheritance(); } + child->_FinalizeInheritance(); } // Method Description: diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp b/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp index 20dfacbd828..1c4fd45cd90 100644 --- a/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp +++ b/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp @@ -191,6 +191,15 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation // - Creates a TerminalSettingsCreateResult from a parent TerminalSettingsCreateResult // - The returned defaultSettings inherits from the parent's defaultSettings, and the // returned unfocusedSettings inherits from the returned defaultSettings + // - Note that the unfocused settings needs to be entirely unchanged _except_ we need to + // set its parent to the other settings object that we return. This is because the overrides + // made by the control will live in that other settings object, so we want to make + // sure the unfocused settings inherit from that. + // - Another way to think about this is that initially we have UnfocusedSettings inherit + // from DefaultSettings. This function simply adds another TerminalSettings object + // in the middle of these two, so UnfocusedSettings now inherits from the new object + // and the new object inherits from the DefaultSettings. And this new object is what + // the control can put overrides in. // Arguments: // - parent: the TerminalSettingsCreateResult that we create a new one from // Return Value: