From ce1978df0ccdf1deba92512485e1b36e8cdb0df7 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Tue, 7 Nov 2023 12:26:31 +0100 Subject: [PATCH 1/3] Enable AtlasEngine by default --- .../CascadiaSettingsSerialization.cpp | 19 ------------------- .../TerminalSettingsModel/MTSMSettings.h | 2 +- .../TerminalSettingsModel/TerminalSettings.h | 2 +- src/cascadia/inc/ControlProperties.h | 2 +- src/features.xml | 10 ---------- 5 files changed, 3 insertions(+), 32 deletions(-) diff --git a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp index 8964169f207..15e62efd4fa 100644 --- a/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp @@ -949,25 +949,6 @@ void CascadiaSettings::_researchOnLoad() // Only do this if we're actually being sampled if (TraceLoggingProviderEnabled(g_hSettingsModelProvider, 0, MICROSOFT_KEYWORD_MEASURES)) { - // GH#13936: We're interested in how many users opt out of useAtlasEngine, - // indicating major issues that would require us to disable it by default again. - { - size_t enabled[2]{}; - for (const auto& profile : _activeProfiles) - { - enabled[profile.UseAtlasEngine()]++; - } - - TraceLoggingWrite( - g_hSettingsModelProvider, - "AtlasEngine_Usage", - TraceLoggingDescription("Event emitted upon settings load, containing the number of profiles opted-in/out of useAtlasEngine"), - TraceLoggingUIntPtr(enabled[0], "UseAtlasEngineDisabled", "Number of profiles for which AtlasEngine is disabled"), - TraceLoggingUIntPtr(enabled[1], "UseAtlasEngineEnabled", "Number of profiles for which AtlasEngine is enabled"), - TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), - TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); - } - // ----------------------------- RE: Themes ---------------------------- const auto numThemes = GlobalSettings().Themes().Size(); const auto themeInUse = GlobalSettings().CurrentTheme().Name(); diff --git a/src/cascadia/TerminalSettingsModel/MTSMSettings.h b/src/cascadia/TerminalSettingsModel/MTSMSettings.h index 15e91a1d7ae..d0dc6bfcca5 100644 --- a/src/cascadia/TerminalSettingsModel/MTSMSettings.h +++ b/src/cascadia/TerminalSettingsModel/MTSMSettings.h @@ -90,7 +90,7 @@ Author(s): X(hstring, TabTitle, "tabTitle") \ X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible) \ X(IEnvironmentVariableMap, EnvironmentVariables, "environment", nullptr) \ - X(bool, UseAtlasEngine, "useAtlasEngine", Feature_AtlasEngine::IsEnabled()) \ + X(bool, UseAtlasEngine, "useAtlasEngine", true) \ X(bool, RightClickContextMenu, "experimental.rightClickContextMenu", false) \ X(Windows::Foundation::Collections::IVector, BellSound, "bellSound", nullptr) \ X(bool, Elevate, "elevate", false) \ diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettings.h b/src/cascadia/TerminalSettingsModel/TerminalSettings.h index 60c9b5fb2c2..abc210b9d94 100644 --- a/src/cascadia/TerminalSettingsModel/TerminalSettings.h +++ b/src/cascadia/TerminalSettingsModel/TerminalSettings.h @@ -148,7 +148,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation INHERITABLE_SETTING(Model::TerminalSettings, IEnvironmentVariableMap, EnvironmentVariables); INHERITABLE_SETTING(Model::TerminalSettings, Microsoft::Terminal::Control::ScrollbarState, ScrollState, Microsoft::Terminal::Control::ScrollbarState::Visible); - INHERITABLE_SETTING(Model::TerminalSettings, bool, UseAtlasEngine, false); + INHERITABLE_SETTING(Model::TerminalSettings, bool, UseAtlasEngine, true); INHERITABLE_SETTING(Model::TerminalSettings, Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale); diff --git a/src/cascadia/inc/ControlProperties.h b/src/cascadia/inc/ControlProperties.h index c18e70e7cb2..2c8c8ad48bb 100644 --- a/src/cascadia/inc/ControlProperties.h +++ b/src/cascadia/inc/ControlProperties.h @@ -72,7 +72,7 @@ X(winrt::Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, winrt::Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale) \ X(bool, ForceFullRepaintRendering, false) \ X(bool, SoftwareRendering, false) \ - X(bool, UseAtlasEngine, false) \ + X(bool, UseAtlasEngine, true) \ X(bool, UseBackgroundImageForWindow, false) \ X(bool, ShowMarks, false) \ X(bool, RightClickContextMenu, false) diff --git a/src/features.xml b/src/features.xml index 4656ef0ffd5..be08ced6932 100644 --- a/src/features.xml +++ b/src/features.xml @@ -76,16 +76,6 @@ - - Feature_AtlasEngine - If enabled, AtlasEngine is used by default - AlwaysEnabled - - Release - WindowsInbox - - - Feature_AtlasEnginePresentFallback We don't feel super confident in our usage of the Present1 API, so this settings adds a fallback to Present on error From 3a10fb8564549c5ba8c4b3ba0ffbfa7182cbf43a Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Thu, 30 Nov 2023 18:03:14 +0100 Subject: [PATCH 2/3] Fix unit tests --- .../UnitTests_Control/ControlCoreTests.cpp | 14 ++++++++------ .../ControlInteractivityTests.cpp | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/cascadia/UnitTests_Control/ControlCoreTests.cpp b/src/cascadia/UnitTests_Control/ControlCoreTests.cpp index f34ca5a6bfd..1e734816e53 100644 --- a/src/cascadia/UnitTests_Control/ControlCoreTests.cpp +++ b/src/cascadia/UnitTests_Control/ControlCoreTests.cpp @@ -80,9 +80,10 @@ namespace ControlUnitTests void _standardInit(winrt::com_ptr core) { - // "Consolas" ends up with an actual size of 9x21 at 96DPI. So - // let's just arbitrarily start with a 270x420px (30x20 chars) window - core->Initialize(270, 420, 1.0); + // "Consolas" ends up with an actual size of 9x19 at 96DPI. So + // let's just arbitrarily start with a 270x380px (30x20 chars) window + core->Initialize(270, 380, 1.0); + core->_terminal->_suppressLockChecks = true; VERIFY_IS_TRUE(core->_initializedTerminal); VERIFY_ARE_EQUAL(20, core->_terminal->GetViewport().Height()); } @@ -113,9 +114,10 @@ namespace ControlUnitTests VERIFY_IS_NOT_NULL(core); VERIFY_IS_FALSE(core->_initializedTerminal); - // "Consolas" ends up with an actual size of 9x21 at 96DPI. So - // let's just arbitrarily start with a 270x420px (30x20 chars) window - core->Initialize(270, 420, 1.0); + // "Consolas" ends up with an actual size of 9x19 at 96DPI. So + // let's just arbitrarily start with a 270x380px (30x20 chars) window + core->Initialize(270, 380, 1.0); + core->_terminal->_suppressLockChecks = true; VERIFY_IS_TRUE(core->_initializedTerminal); VERIFY_ARE_EQUAL(30, core->_terminal->GetViewport().Width()); } diff --git a/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp b/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp index a48aa968944..f6da97aed7e 100644 --- a/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp +++ b/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp @@ -88,9 +88,10 @@ namespace ControlUnitTests void _standardInit(winrt::com_ptr core, winrt::com_ptr interactivity) { - // "Consolas" ends up with an actual size of 9x21 at 96DPI. So - // let's just arbitrarily start with a 270x420px (30x20 chars) window - core->Initialize(270, 420, 1.0); + // "Consolas" ends up with an actual size of 9x19 at 96DPI. So + // let's just arbitrarily start with a 270x380px (30x20 chars) window + core->Initialize(270, 380, 1.0); + core->_terminal->_suppressLockChecks = true; VERIFY_IS_TRUE(core->_initializedTerminal); VERIFY_ARE_EQUAL(20, core->_terminal->GetViewport().Height()); interactivity->Initialize(); From 7f0643c95ad28a67db0066c55878cc70d6a936ea Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Fri, 1 Dec 2023 00:43:20 +0100 Subject: [PATCH 3/3] Fix Release compilation --- src/cascadia/UnitTests_Control/ControlCoreTests.cpp | 4 ++++ src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/cascadia/UnitTests_Control/ControlCoreTests.cpp b/src/cascadia/UnitTests_Control/ControlCoreTests.cpp index 1e734816e53..c38c0221c5a 100644 --- a/src/cascadia/UnitTests_Control/ControlCoreTests.cpp +++ b/src/cascadia/UnitTests_Control/ControlCoreTests.cpp @@ -83,7 +83,9 @@ namespace ControlUnitTests // "Consolas" ends up with an actual size of 9x19 at 96DPI. So // let's just arbitrarily start with a 270x380px (30x20 chars) window core->Initialize(270, 380, 1.0); +#ifndef NDEBUG core->_terminal->_suppressLockChecks = true; +#endif VERIFY_IS_TRUE(core->_initializedTerminal); VERIFY_ARE_EQUAL(20, core->_terminal->GetViewport().Height()); } @@ -117,7 +119,9 @@ namespace ControlUnitTests // "Consolas" ends up with an actual size of 9x19 at 96DPI. So // let's just arbitrarily start with a 270x380px (30x20 chars) window core->Initialize(270, 380, 1.0); +#ifndef NDEBUG core->_terminal->_suppressLockChecks = true; +#endif VERIFY_IS_TRUE(core->_initializedTerminal); VERIFY_ARE_EQUAL(30, core->_terminal->GetViewport().Width()); } diff --git a/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp b/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp index f6da97aed7e..192cc2ad9d8 100644 --- a/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp +++ b/src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp @@ -91,7 +91,9 @@ namespace ControlUnitTests // "Consolas" ends up with an actual size of 9x19 at 96DPI. So // let's just arbitrarily start with a 270x380px (30x20 chars) window core->Initialize(270, 380, 1.0); +#ifndef NDEBUG core->_terminal->_suppressLockChecks = true; +#endif VERIFY_IS_TRUE(core->_initializedTerminal); VERIFY_ARE_EQUAL(20, core->_terminal->GetViewport().Height()); interactivity->Initialize();