Merge remote-tracking branch 'origin/main' into dev/migrie/f/just-elevated-state-2
This commit is contained in:
commit
507a48ed68
|
@ -1401,7 +1401,8 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"acrylicOpacity": {
|
"acrylicOpacity": {
|
||||||
"default": 0.5,
|
"default": 0.5,
|
||||||
"description": "When useAcrylic is set to true, it sets the transparency of the window for the profile. Accepts floating point values from 0-1 (default 0.5).",
|
"description": "[deprecated] Please use `opacity` instead.",
|
||||||
|
"deprecated": true,
|
||||||
"maximum": 1,
|
"maximum": 1,
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
@ -1614,6 +1615,13 @@
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"opacity": {
|
||||||
|
"default": 100,
|
||||||
|
"description": "Sets the opacity of the window for the profile. Accepts values from 0-100. Defaults to 50 when useAcrylic is set to true.",
|
||||||
|
"maximum": 100,
|
||||||
|
"minimum": 0,
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"padding": {
|
"padding": {
|
||||||
"default": "8, 8, 8, 8",
|
"default": "8, 8, 8, 8",
|
||||||
"description": "Sets the padding around the text within the window. Can have three different formats:\n -\"#\" sets the same padding for all sides \n -\"#, #\" sets the same padding for left-right and top-bottom\n -\"#, #, #, #\" sets the padding individually for left, top, right, and bottom.",
|
"description": "Sets the padding around the text within the window. Can have three different formats:\n -\"#\" sets the same padding for all sides \n -\"#, #\" sets the same padding for left-right and top-bottom\n -\"#, #, #, #\" sets the padding individually for left, top, right, and bottom.",
|
||||||
|
|
|
@ -140,12 +140,12 @@
|
||||||
<!-- **END VC LIBS HACK** -->
|
<!-- **END VC LIBS HACK** -->
|
||||||
|
|
||||||
<!-- This is required to get the package dependency in the AppXManifest. -->
|
<!-- This is required to get the package dependency in the AppXManifest. -->
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace winrt::SampleApp::implementation
|
||||||
|
|
||||||
WINRT_PROPERTY(winrt::hstring, ProfileName);
|
WINRT_PROPERTY(winrt::hstring, ProfileName);
|
||||||
WINRT_PROPERTY(bool, UseAcrylic, false);
|
WINRT_PROPERTY(bool, UseAcrylic, false);
|
||||||
WINRT_PROPERTY(double, TintOpacity, 0.5);
|
WINRT_PROPERTY(double, Opacity, .5);
|
||||||
WINRT_PROPERTY(winrt::hstring, Padding, DEFAULT_PADDING);
|
WINRT_PROPERTY(winrt::hstring, Padding, DEFAULT_PADDING);
|
||||||
WINRT_PROPERTY(winrt::hstring, FontFace, L"Consolas");
|
WINRT_PROPERTY(winrt::hstring, FontFace, L"Consolas");
|
||||||
WINRT_PROPERTY(int32_t, FontSize, DEFAULT_FONT_SIZE);
|
WINRT_PROPERTY(int32_t, FontSize, DEFAULT_FONT_SIZE);
|
||||||
|
|
|
@ -147,13 +147,13 @@
|
||||||
<!-- ========================= Globals ======================== -->
|
<!-- ========================= Globals ======================== -->
|
||||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||||
|
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
@ -80,13 +80,13 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
|
@ -120,14 +120,14 @@
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||||
|
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets" Condition="Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets" Condition="Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets'))" />
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||||
<package id="Microsoft.VCRTForwarders.140" version="1.0.4" targetFramework="native" />
|
<package id="Microsoft.VCRTForwarders.140" version="1.0.4" targetFramework="native" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
|
@ -146,12 +146,12 @@
|
||||||
<!-- **END VC LIBS HACK** -->
|
<!-- **END VC LIBS HACK** -->
|
||||||
|
|
||||||
<!-- This is required to get the package dependency in the AppXManifest. -->
|
<!-- This is required to get the package dependency in the AppXManifest. -->
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
||||||
|
|
|
@ -98,10 +98,10 @@
|
||||||
<!-- From Microsoft.UI.Xaml.targets -->
|
<!-- From Microsoft.UI.Xaml.targets -->
|
||||||
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
||||||
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
||||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- We actually can just straight up reference MUX here, it's fine -->
|
<!-- We actually can just straight up reference MUX here, it's fine -->
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -92,11 +92,11 @@
|
||||||
<!-- From Microsoft.UI.Xaml.targets -->
|
<!-- From Microsoft.UI.Xaml.targets -->
|
||||||
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
||||||
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
||||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- We actually can just straight up reference MUX here, it's fine -->
|
<!-- We actually can just straight up reference MUX here, it's fine -->
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)\src\common.build.post.props" />
|
<Import Project="$(OpenConsoleDir)\src\common.build.post.props" />
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// - Add the given peasant to the list of peasants we're tracking. This
|
// - Add the given peasant to the list of peasants we're tracking. This
|
||||||
// Peasant may have already been assigned an ID. If it hasn't, then give
|
// Peasant may have already been assigned an ID. If it hasn't, then give
|
||||||
// it an ID.
|
// it an ID.
|
||||||
|
// - NB: this takes a unique_lock on _peasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - peasant: the new Peasant to track.
|
// - peasant: the new Peasant to track.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
|
@ -71,10 +72,24 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
{
|
{
|
||||||
// Peasant already had an ID (from an older monarch). Leave that one
|
// Peasant already had an ID (from an older monarch). Leave that one
|
||||||
// be. Make sure that the next peasant's ID is higher than it.
|
// be. Make sure that the next peasant's ID is higher than it.
|
||||||
_nextPeasantID = providedID >= _nextPeasantID ? providedID + 1 : _nextPeasantID;
|
// If multiple peasants are added concurrently we keep trying to update
|
||||||
|
// until we get to set the new id.
|
||||||
|
uint64_t current;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
current = _nextPeasantID.load(std::memory_order_relaxed);
|
||||||
|
} while (current <= providedID && !_nextPeasantID.compare_exchange_weak(current, providedID + 1, std::memory_order_relaxed));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newPeasantsId = peasant.GetID();
|
auto newPeasantsId = peasant.GetID();
|
||||||
|
|
||||||
|
// Keep track of which peasant we are
|
||||||
|
// SAFETY: this is only true for one peasant, and each peasant
|
||||||
|
// is only added to a monarch once, so we do not need synchronization here.
|
||||||
|
if (peasant.GetPID() == _ourPID)
|
||||||
|
{
|
||||||
|
_ourPeasantId = newPeasantsId;
|
||||||
|
}
|
||||||
// Add an event listener to the peasant's WindowActivated event.
|
// Add an event listener to the peasant's WindowActivated event.
|
||||||
peasant.WindowActivated({ this, &Monarch::_peasantWindowActivated });
|
peasant.WindowActivated({ this, &Monarch::_peasantWindowActivated });
|
||||||
peasant.IdentifyWindowsRequested({ this, &Monarch::_identifyWindows });
|
peasant.IdentifyWindowsRequested({ this, &Monarch::_identifyWindows });
|
||||||
|
@ -84,7 +99,10 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
peasant.HideNotificationIconRequested([this](auto&&, auto&&) { _HideNotificationIconRequestedHandlers(*this, nullptr); });
|
peasant.HideNotificationIconRequested([this](auto&&, auto&&) { _HideNotificationIconRequestedHandlers(*this, nullptr); });
|
||||||
peasant.QuitAllRequested({ this, &Monarch::_handleQuitAll });
|
peasant.QuitAllRequested({ this, &Monarch::_handleQuitAll });
|
||||||
|
|
||||||
_peasants[newPeasantsId] = peasant;
|
{
|
||||||
|
std::unique_lock lock{ _peasantsMutex };
|
||||||
|
_peasants[newPeasantsId] = peasant;
|
||||||
|
}
|
||||||
|
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
"Monarch_AddPeasant",
|
"Monarch_AddPeasant",
|
||||||
|
@ -124,9 +142,15 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// closing all windows.
|
// closing all windows.
|
||||||
_QuitAllRequestedHandlers(*this, nullptr);
|
_QuitAllRequestedHandlers(*this, nullptr);
|
||||||
|
|
||||||
|
_quitting.store(true);
|
||||||
// Tell all peasants to exit.
|
// Tell all peasants to exit.
|
||||||
const auto callback = [&](const auto& /*id*/, const auto& p) {
|
const auto callback = [&](const auto& id, const auto& p) {
|
||||||
p.Quit();
|
// We want to tell our peasant to quit last, so that we don't try
|
||||||
|
// to perform a bunch of elections on quit.
|
||||||
|
if (id != _ourPeasantId)
|
||||||
|
{
|
||||||
|
p.Quit();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const auto onError = [&](const auto& id) {
|
const auto onError = [&](const auto& id) {
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
|
@ -137,18 +161,46 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
};
|
};
|
||||||
|
|
||||||
_forEachPeasant(callback, onError);
|
_forEachPeasant(callback, onError);
|
||||||
|
|
||||||
|
{
|
||||||
|
std::shared_lock lock{ _peasantsMutex };
|
||||||
|
const auto peasantSearch = _peasants.find(_ourPeasantId);
|
||||||
|
if (peasantSearch != _peasants.end())
|
||||||
|
{
|
||||||
|
peasantSearch->second.Quit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Somehow we don't have our own peasant, this should never happen.
|
||||||
|
// We are trying to quit anyways so just fail here.
|
||||||
|
assert(peasantSearch != _peasants.end());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Tells the monarch that a peasant is being closed.
|
// - Tells the monarch that a peasant is being closed.
|
||||||
|
// - NB: this (separately) takes unique locks on _peasantsMutex and
|
||||||
|
// _mruPeasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - peasantId: the id of the peasant
|
// - peasantId: the id of the peasant
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - <none>
|
// - <none>
|
||||||
void Monarch::SignalClose(const uint64_t peasantId)
|
void Monarch::SignalClose(const uint64_t peasantId)
|
||||||
{
|
{
|
||||||
_clearOldMruEntries(peasantId);
|
// If we are quitting we don't care about maintaining our list of
|
||||||
_peasants.erase(peasantId);
|
// peasants anymore, and don't need to notify the host that something
|
||||||
|
// changed.
|
||||||
|
if (_quitting.load(std::memory_order_acquire))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_clearOldMruEntries({ peasantId });
|
||||||
|
{
|
||||||
|
std::unique_lock lock{ _peasantsMutex };
|
||||||
|
_peasants.erase(peasantId);
|
||||||
|
}
|
||||||
_WindowClosedHandlers(nullptr, nullptr);
|
_WindowClosedHandlers(nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,23 +212,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// - the number of active peasants.
|
// - the number of active peasants.
|
||||||
uint64_t Monarch::GetNumberOfPeasants()
|
uint64_t Monarch::GetNumberOfPeasants()
|
||||||
{
|
{
|
||||||
auto num = 0;
|
std::shared_lock lock{ _peasantsMutex };
|
||||||
auto callback = [&](const auto& /*id*/, const auto& p) {
|
return _peasants.size();
|
||||||
// Check that the peasant is alive, and if so increment the count
|
|
||||||
p.GetID();
|
|
||||||
num += 1;
|
|
||||||
};
|
|
||||||
auto onError = [](const auto& id) {
|
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
|
||||||
"Monarch_GetNumberOfPeasants_Failed",
|
|
||||||
TraceLoggingInt64(id, "peasantID", "The ID of the peasant which we could not enumerate"),
|
|
||||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
|
||||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
|
||||||
};
|
|
||||||
|
|
||||||
_forEachPeasant(callback, onError);
|
|
||||||
|
|
||||||
return num;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
|
@ -197,16 +234,25 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Lookup a peasant by its ID. If the peasant has died, this will also
|
// - Lookup a peasant by its ID. If the peasant has died, this will also
|
||||||
// remove the peasant from our list of peasants.
|
// remove the peasant from our list of peasants.
|
||||||
|
// - NB: this (separately) takes unique locks on _peasantsMutex and
|
||||||
|
// _mruPeasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - peasantID: The ID Of the peasant to find
|
// - peasantID: The ID Of the peasant to find
|
||||||
|
// - clearMruPeasantOnFailure: When true this function will handle clearing
|
||||||
|
// from _mruPeasants if a peasant was not found, otherwise the caller is
|
||||||
|
// expected to handle that cleanup themselves.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - the peasant if it exists in our map, otherwise null
|
// - the peasant if it exists in our map, otherwise null
|
||||||
Remoting::IPeasant Monarch::_getPeasant(uint64_t peasantID)
|
Remoting::IPeasant Monarch::_getPeasant(uint64_t peasantID, bool clearMruPeasantOnFailure)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const auto peasantSearch = _peasants.find(peasantID);
|
IPeasant maybeThePeasant = nullptr;
|
||||||
auto maybeThePeasant = peasantSearch == _peasants.end() ? nullptr : peasantSearch->second;
|
{
|
||||||
|
std::shared_lock lock{ _peasantsMutex };
|
||||||
|
const auto peasantSearch = _peasants.find(peasantID);
|
||||||
|
maybeThePeasant = peasantSearch == _peasants.end() ? nullptr : peasantSearch->second;
|
||||||
|
}
|
||||||
// Ask the peasant for their PID. This will validate that they're
|
// Ask the peasant for their PID. This will validate that they're
|
||||||
// actually still alive.
|
// actually still alive.
|
||||||
if (maybeThePeasant)
|
if (maybeThePeasant)
|
||||||
|
@ -218,12 +264,19 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
LOG_CAUGHT_EXCEPTION();
|
LOG_CAUGHT_EXCEPTION();
|
||||||
// Remove the peasant from the list of peasants
|
|
||||||
_peasants.erase(peasantID);
|
|
||||||
|
|
||||||
// Remove the peasant from the list of MRU windows. They're dead.
|
// Remove the peasant from the list of peasants
|
||||||
// They can't be the MRU anymore.
|
{
|
||||||
_clearOldMruEntries(peasantID);
|
std::unique_lock lock{ _peasantsMutex };
|
||||||
|
_peasants.erase(peasantID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clearMruPeasantOnFailure)
|
||||||
|
{
|
||||||
|
// Remove the peasant from the list of MRU windows. They're dead.
|
||||||
|
// They can't be the MRU anymore.
|
||||||
|
_clearOldMruEntries({ peasantID });
|
||||||
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -244,39 +297,27 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<uint64_t> peasantsToErase{};
|
|
||||||
uint64_t result = 0;
|
uint64_t result = 0;
|
||||||
for (const auto& [id, p] : _peasants)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
auto otherName = p.WindowName();
|
|
||||||
if (otherName == name)
|
|
||||||
{
|
|
||||||
result = id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
LOG_CAUGHT_EXCEPTION();
|
|
||||||
// Normally, we'd just erase the peasant here. However, we can't
|
|
||||||
// erase from the map while we're iterating over it like this.
|
|
||||||
// Instead, pull a good ole Java and collect this id for removal
|
|
||||||
// later.
|
|
||||||
peasantsToErase.push_back(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the dead peasants we came across while iterating.
|
const auto callback = [&](const auto& id, const auto& p) {
|
||||||
for (const auto& id : peasantsToErase)
|
auto otherName = p.WindowName();
|
||||||
{
|
if (otherName == name)
|
||||||
// Remove the peasant from the list of peasants
|
{
|
||||||
_peasants.erase(id);
|
result = id;
|
||||||
// Remove the peasant from the list of MRU windows. They're dead.
|
return false;
|
||||||
// They can't be the MRU anymore.
|
}
|
||||||
_clearOldMruEntries(id);
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const auto onError = [&](const auto& id) {
|
||||||
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
|
"Monarch_lookupPeasantIdForName_Failed",
|
||||||
|
TraceLoggingInt64(id, "peasantID", "The ID of the peasant which we could not get the name of"),
|
||||||
|
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||||
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||||
|
};
|
||||||
|
|
||||||
|
_forEachPeasant(callback, onError);
|
||||||
|
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
"Monarch_lookupPeasantIdForName",
|
"Monarch_lookupPeasantIdForName",
|
||||||
|
@ -328,33 +369,42 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// - Helper for removing a peasant from the list of MRU peasants. We want to
|
// - Helper for removing a peasant from the list of MRU peasants. We want to
|
||||||
// do this both when the peasant dies, and also when the peasant is newly
|
// do this both when the peasant dies, and also when the peasant is newly
|
||||||
// activated (so that we don't leave an old entry for it in the list).
|
// activated (so that we don't leave an old entry for it in the list).
|
||||||
|
// - NB: This takes a unique lock on _mruPeasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - peasantID: The ID of the peasant to remove from the MRU list
|
// - peasantIds: The list of peasant IDs to remove from the MRU list
|
||||||
// Return Value:
|
// Return Value:
|
||||||
// - <none>
|
// - <none>
|
||||||
void Monarch::_clearOldMruEntries(const uint64_t peasantID)
|
void Monarch::_clearOldMruEntries(const std::unordered_set<uint64_t>& peasantIds)
|
||||||
{
|
{
|
||||||
auto result = std::find_if(_mruPeasants.begin(),
|
if (peasantIds.size() == 0)
|
||||||
_mruPeasants.end(),
|
|
||||||
[peasantID](auto&& other) {
|
|
||||||
return peasantID == other.PeasantID();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (result != std::end(_mruPeasants))
|
|
||||||
{
|
{
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
return;
|
||||||
"Monarch_RemovedPeasantFromDesktop",
|
|
||||||
TraceLoggingUInt64(peasantID, "peasantID", "The ID of the peasant"),
|
|
||||||
TraceLoggingGuid(result->DesktopID(), "desktopGuid", "The GUID of the previous desktop the window was on"),
|
|
||||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
|
||||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
|
||||||
|
|
||||||
_mruPeasants.erase(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_lock lock{ _mruPeasantsMutex };
|
||||||
|
auto partition = std::remove_if(_mruPeasants.begin(), _mruPeasants.end(), [&](const auto& p) {
|
||||||
|
const auto id = p.PeasantID();
|
||||||
|
// remove the element if it was found in the list to erase.
|
||||||
|
if (peasantIds.count(id) == 1)
|
||||||
|
{
|
||||||
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
|
"Monarch_RemovedPeasantFromDesktop",
|
||||||
|
TraceLoggingUInt64(id, "peasantID", "The ID of the peasant"),
|
||||||
|
TraceLoggingGuid(p.DesktopID(), "desktopGuid", "The GUID of the previous desktop the window was on"),
|
||||||
|
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||||
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Remove everything that was in the list
|
||||||
|
_mruPeasants.erase(partition, _mruPeasants.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Actually handle inserting the WindowActivatedArgs into our list of MRU windows.
|
// - Actually handle inserting the WindowActivatedArgs into our list of MRU windows.
|
||||||
|
// - NB: this takes a unique_lock on _mruPeasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - localArgs: an in-proc WindowActivatedArgs that we should add to our list of MRU windows.
|
// - localArgs: an in-proc WindowActivatedArgs that we should add to our list of MRU windows.
|
||||||
// Return Value:
|
// Return Value:
|
||||||
|
@ -365,19 +415,22 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
|
|
||||||
// * Check all the current lists to look for this peasant.
|
// * Check all the current lists to look for this peasant.
|
||||||
// remove it from any where it exists.
|
// remove it from any where it exists.
|
||||||
_clearOldMruEntries(localArgs->PeasantID());
|
_clearOldMruEntries({ localArgs->PeasantID() });
|
||||||
|
|
||||||
// * If the current desktop doesn't have a vector, add one.
|
// * If the current desktop doesn't have a vector, add one.
|
||||||
const auto desktopGuid{ localArgs->DesktopID() };
|
const auto desktopGuid{ localArgs->DesktopID() };
|
||||||
|
|
||||||
// * Add this args list. By using lower_bound with insert, we can get it
|
{
|
||||||
// into exactly the right spot, without having to re-sort the whole
|
std::unique_lock lock{ _mruPeasantsMutex };
|
||||||
// array.
|
// * Add this args list. By using lower_bound with insert, we can get it
|
||||||
_mruPeasants.insert(std::lower_bound(_mruPeasants.begin(),
|
// into exactly the right spot, without having to re-sort the whole
|
||||||
_mruPeasants.end(),
|
// array.
|
||||||
*localArgs,
|
_mruPeasants.insert(std::lower_bound(_mruPeasants.begin(),
|
||||||
[](const auto& first, const auto& second) { return first.ActivatedTime() > second.ActivatedTime(); }),
|
_mruPeasants.end(),
|
||||||
*localArgs);
|
*localArgs,
|
||||||
|
[](const auto& first, const auto& second) { return first.ActivatedTime() > second.ActivatedTime(); }),
|
||||||
|
*localArgs);
|
||||||
|
}
|
||||||
|
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
"Monarch_SetMostRecentPeasant",
|
"Monarch_SetMostRecentPeasant",
|
||||||
|
@ -391,6 +444,9 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Retrieves the ID of the MRU peasant window. If requested, will limit
|
// - Retrieves the ID of the MRU peasant window. If requested, will limit
|
||||||
// the search to windows that are on the current desktop.
|
// the search to windows that are on the current desktop.
|
||||||
|
// - NB: This method will hold a shared lock on _mruPeasantsMutex and
|
||||||
|
// potentially a unique_lock on _peasantsMutex at the same time.
|
||||||
|
// Separately it might hold a unique_lock on _mruPeasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - limitToCurrentDesktop: if true, only return the MRU peasant that's
|
// - limitToCurrentDesktop: if true, only return the MRU peasant that's
|
||||||
// actually on the current desktop.
|
// actually on the current desktop.
|
||||||
|
@ -403,8 +459,13 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// - the ID of the most recent peasant, otherwise 0 if we could not find one.
|
// - the ID of the most recent peasant, otherwise 0 if we could not find one.
|
||||||
uint64_t Monarch::_getMostRecentPeasantID(const bool limitToCurrentDesktop, const bool ignoreQuakeWindow)
|
uint64_t Monarch::_getMostRecentPeasantID(const bool limitToCurrentDesktop, const bool ignoreQuakeWindow)
|
||||||
{
|
{
|
||||||
|
std::shared_lock lock{ _mruPeasantsMutex };
|
||||||
if (_mruPeasants.empty())
|
if (_mruPeasants.empty())
|
||||||
{
|
{
|
||||||
|
// unlock the mruPeasants mutex to make sure we can't deadlock here.
|
||||||
|
lock.unlock();
|
||||||
|
// Only need a shared lock for read
|
||||||
|
std::shared_lock peasantsLock{ _peasantsMutex };
|
||||||
// We haven't yet been told the MRU peasant. Just use the first one.
|
// We haven't yet been told the MRU peasant. Just use the first one.
|
||||||
// This is just gonna be a random one, but really shouldn't happen
|
// This is just gonna be a random one, but really shouldn't happen
|
||||||
// in practice. The WindowManager should set the MRU peasant
|
// in practice. The WindowManager should set the MRU peasant
|
||||||
|
@ -445,15 +506,17 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// - If it isn't on the current desktop, we'll loop again, on the
|
// - If it isn't on the current desktop, we'll loop again, on the
|
||||||
// following peasant.
|
// following peasant.
|
||||||
// * If we don't care, then we'll just return that one.
|
// * If we don't care, then we'll just return that one.
|
||||||
//
|
uint64_t result = 0;
|
||||||
// We're not just using an iterator because the contents of the list
|
std::unordered_set<uint64_t> peasantsToErase{};
|
||||||
// might change while we're iterating here (if the peasant is dead we'll
|
for (const auto& mruWindowArgs : _mruPeasants)
|
||||||
// remove it from the list).
|
|
||||||
int positionInList = 0;
|
|
||||||
while (_mruPeasants.cbegin() + positionInList < _mruPeasants.cend())
|
|
||||||
{
|
{
|
||||||
const auto mruWindowArgs{ *(_mruPeasants.begin() + positionInList) };
|
// Try to get the peasant, but do not have _getPeasant clean up old
|
||||||
const auto peasant{ _getPeasant(mruWindowArgs.PeasantID()) };
|
// _mruPeasants because we are iterating here.
|
||||||
|
// SAFETY: _getPeasant can take a unique_lock on _peasantsMutex if
|
||||||
|
// it detects a peasant is dead. Currently _getMostRecentPeasantId
|
||||||
|
// is the only method that holds a lock on both _mruPeasantsMutex and
|
||||||
|
// _peasantsMutex at the same time so there cannot be a deadlock here.
|
||||||
|
const auto peasant{ _getPeasant(mruWindowArgs.PeasantID(), false) };
|
||||||
if (!peasant)
|
if (!peasant)
|
||||||
{
|
{
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
|
@ -467,6 +530,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// We'll go through the loop again. We removed the current one
|
// We'll go through the loop again. We removed the current one
|
||||||
// at positionInList, so the next one in positionInList will be
|
// at positionInList, so the next one in positionInList will be
|
||||||
// a new, different peasant.
|
// a new, different peasant.
|
||||||
|
peasantsToErase.emplace(mruWindowArgs.PeasantID());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +568,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
"true if this window was in fact on the current desktop"),
|
"true if this window was in fact on the current desktop"),
|
||||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||||
return mruWindowArgs.PeasantID();
|
result = mruWindowArgs.PeasantID();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// If this window wasn't on the current desktop, another one
|
// If this window wasn't on the current desktop, another one
|
||||||
// might be. We'll increment positionInList below, and try
|
// might be. We'll increment positionInList below, and try
|
||||||
|
@ -518,20 +583,30 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||||
|
|
||||||
return mruWindowArgs.PeasantID();
|
result = mruWindowArgs.PeasantID();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
positionInList++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Here, we've checked all the windows, and none of them was both alive
|
lock.unlock();
|
||||||
// and the most recent (on this desktop). Just return 0 - the caller
|
|
||||||
// will use this to create a new window.
|
|
||||||
TraceLoggingWrite(g_hRemotingProvider,
|
|
||||||
"Monarch_getMostRecentPeasantID_NotFound",
|
|
||||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
|
||||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
|
||||||
|
|
||||||
return 0;
|
if (peasantsToErase.size() > 0)
|
||||||
|
{
|
||||||
|
_clearOldMruEntries(peasantsToErase);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result == 0)
|
||||||
|
{
|
||||||
|
// Here, we've checked all the windows, and none of them was both alive
|
||||||
|
// and the most recent (on this desktop). Just return 0 - the caller
|
||||||
|
// will use this to create a new window.
|
||||||
|
TraceLoggingWrite(g_hRemotingProvider,
|
||||||
|
"Monarch_getMostRecentPeasantID_NotFound",
|
||||||
|
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||||
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
|
@ -855,7 +930,10 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
Windows::Foundation::Collections::IVectorView<PeasantInfo> Monarch::GetPeasantInfos()
|
Windows::Foundation::Collections::IVectorView<PeasantInfo> Monarch::GetPeasantInfos()
|
||||||
{
|
{
|
||||||
std::vector<PeasantInfo> names;
|
std::vector<PeasantInfo> names;
|
||||||
names.reserve(_peasants.size());
|
{
|
||||||
|
std::shared_lock lock{ _peasantsMutex };
|
||||||
|
names.reserve(_peasants.size());
|
||||||
|
}
|
||||||
|
|
||||||
const auto func = [&](const auto& id, const auto& p) -> void {
|
const auto func = [&](const auto& id, const auto& p) -> void {
|
||||||
names.push_back({ id, p.WindowName(), p.ActiveTabTitle() });
|
names.push_back({ id, p.WindowName(), p.ActiveTabTitle() });
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "Peasant.h"
|
#include "Peasant.h"
|
||||||
#include "../cascadia/inc/cppwinrt_utils.h"
|
#include "../cascadia/inc/cppwinrt_utils.h"
|
||||||
#include "WindowActivatedArgs.h"
|
#include "WindowActivatedArgs.h"
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
// We sure different GUIDs here depending on whether we're running a Release,
|
// We sure different GUIDs here depending on whether we're running a Release,
|
||||||
// Preview, or Dev build. This ensures that different installs don't
|
// Preview, or Dev build. This ensures that different installs don't
|
||||||
|
@ -69,23 +70,29 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
private:
|
private:
|
||||||
uint64_t _ourPID;
|
uint64_t _ourPID;
|
||||||
|
|
||||||
uint64_t _nextPeasantID{ 1 };
|
std::atomic<uint64_t> _nextPeasantID{ 1 };
|
||||||
uint64_t _thisPeasantID{ 0 };
|
uint64_t _ourPeasantId{ 0 };
|
||||||
|
|
||||||
|
// When we're quitting we do not care as much about handling some events that we know will be triggered
|
||||||
|
std::atomic<bool> _quitting{ false };
|
||||||
|
|
||||||
winrt::com_ptr<IVirtualDesktopManager> _desktopManager{ nullptr };
|
winrt::com_ptr<IVirtualDesktopManager> _desktopManager{ nullptr };
|
||||||
|
|
||||||
std::unordered_map<uint64_t, winrt::Microsoft::Terminal::Remoting::IPeasant> _peasants;
|
std::unordered_map<uint64_t, winrt::Microsoft::Terminal::Remoting::IPeasant> _peasants;
|
||||||
|
|
||||||
std::vector<Remoting::WindowActivatedArgs> _mruPeasants;
|
std::vector<Remoting::WindowActivatedArgs> _mruPeasants;
|
||||||
|
// These should not be locked at the same time to prevent deadlocks
|
||||||
|
// unless they are both shared_locks.
|
||||||
|
std::shared_mutex _peasantsMutex{};
|
||||||
|
std::shared_mutex _mruPeasantsMutex{};
|
||||||
|
|
||||||
winrt::Microsoft::Terminal::Remoting::IPeasant _getPeasant(uint64_t peasantID);
|
winrt::Microsoft::Terminal::Remoting::IPeasant _getPeasant(uint64_t peasantID, bool clearMruPeasantOnFailure = true);
|
||||||
uint64_t _getMostRecentPeasantID(bool limitToCurrentDesktop, const bool ignoreQuakeWindow);
|
uint64_t _getMostRecentPeasantID(bool limitToCurrentDesktop, const bool ignoreQuakeWindow);
|
||||||
uint64_t _lookupPeasantIdForName(std::wstring_view name);
|
uint64_t _lookupPeasantIdForName(std::wstring_view name);
|
||||||
|
|
||||||
void _peasantWindowActivated(const winrt::Windows::Foundation::IInspectable& sender,
|
void _peasantWindowActivated(const winrt::Windows::Foundation::IInspectable& sender,
|
||||||
const winrt::Microsoft::Terminal::Remoting::WindowActivatedArgs& args);
|
const winrt::Microsoft::Terminal::Remoting::WindowActivatedArgs& args);
|
||||||
void _doHandleActivatePeasant(const winrt::com_ptr<winrt::Microsoft::Terminal::Remoting::implementation::WindowActivatedArgs>& args);
|
void _doHandleActivatePeasant(const winrt::com_ptr<winrt::Microsoft::Terminal::Remoting::implementation::WindowActivatedArgs>& args);
|
||||||
void _clearOldMruEntries(const uint64_t peasantID);
|
void _clearOldMruEntries(const std::unordered_set<uint64_t>& peasantIds);
|
||||||
|
|
||||||
void _forAllPeasantsIgnoringTheDead(std::function<void(const winrt::Microsoft::Terminal::Remoting::IPeasant&, const uint64_t)> callback,
|
void _forAllPeasantsIgnoringTheDead(std::function<void(const winrt::Microsoft::Terminal::Remoting::IPeasant&, const uint64_t)> callback,
|
||||||
std::function<void(const uint64_t)> errorCallback);
|
std::function<void(const uint64_t)> errorCallback);
|
||||||
|
@ -107,6 +114,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
// returns false.
|
// returns false.
|
||||||
// - If any single peasant is dead, then we'll call onError and then add it to a
|
// - If any single peasant is dead, then we'll call onError and then add it to a
|
||||||
// list of peasants to clean up once the loop ends.
|
// list of peasants to clean up once the loop ends.
|
||||||
|
// - NB: this (separately) takes unique locks on _peasantsMutex and
|
||||||
|
// _mruPeasantsMutex.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
// - func: The function to call on each peasant
|
// - func: The function to call on each peasant
|
||||||
// - onError: The function to call if a peasant is dead.
|
// - onError: The function to call if a peasant is dead.
|
||||||
|
@ -119,44 +128,55 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
using R = std::invoke_result_t<F, Map::key_type, Map::mapped_type>;
|
using R = std::invoke_result_t<F, Map::key_type, Map::mapped_type>;
|
||||||
static constexpr auto IsVoid = std::is_void_v<R>;
|
static constexpr auto IsVoid = std::is_void_v<R>;
|
||||||
|
|
||||||
std::vector<uint64_t> peasantsToErase;
|
std::unordered_set<uint64_t> peasantsToErase;
|
||||||
|
|
||||||
for (const auto& [id, p] : _peasants)
|
|
||||||
{
|
{
|
||||||
try
|
std::shared_lock lock{ _peasantsMutex };
|
||||||
|
|
||||||
|
for (const auto& [id, p] : _peasants)
|
||||||
{
|
{
|
||||||
if constexpr (IsVoid)
|
try
|
||||||
{
|
{
|
||||||
func(id, p);
|
if constexpr (IsVoid)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!func(id, p))
|
|
||||||
{
|
{
|
||||||
break;
|
func(id, p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!func(id, p))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
catch (const winrt::hresult_error& exception)
|
||||||
catch (const winrt::hresult_error& exception)
|
{
|
||||||
{
|
onError(id);
|
||||||
onError(id);
|
|
||||||
|
|
||||||
if (exception.code() == 0x800706ba) // The RPC server is unavailable.
|
if (exception.code() == 0x800706ba) // The RPC server is unavailable.
|
||||||
{
|
{
|
||||||
peasantsToErase.emplace_back(id);
|
peasantsToErase.emplace(id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG_CAUGHT_EXCEPTION();
|
LOG_CAUGHT_EXCEPTION();
|
||||||
throw;
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& id : peasantsToErase)
|
if (peasantsToErase.size() > 0)
|
||||||
{
|
{
|
||||||
_peasants.erase(id);
|
// Don't hold a lock on _peasants and _mruPeasants at the same
|
||||||
_clearOldMruEntries(id);
|
// time to avoid deadlocks.
|
||||||
|
{
|
||||||
|
std::unique_lock lock{ _peasantsMutex };
|
||||||
|
for (const auto& id : peasantsToErase)
|
||||||
|
{
|
||||||
|
_peasants.erase(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_clearOldMruEntries(peasantsToErase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -324,6 +324,14 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
||||||
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
TraceLoggingLevel(WINEVENT_LEVEL_VERBOSE),
|
||||||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||||
|
|
||||||
|
// If the peasant asks us to quit we should not try to act in future elections.
|
||||||
|
_peasant.QuitRequested([weakThis{ get_weak() }](auto&&, auto&&) {
|
||||||
|
if (auto wm = weakThis.get())
|
||||||
|
{
|
||||||
|
wm->_monarchWaitInterrupt.SetEvent();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return _peasant;
|
return _peasant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<!-- Include the MUX Controls resources -->
|
<!-- Include the MUX Controls resources -->
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
ControlsResourcesVersion="Version1" />
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -53,10 +53,6 @@ Pane::Pane(const Profile& profile, const TermControl& control, const bool lastFo
|
||||||
_SetupResources();
|
_SetupResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the unfocused border color as the pane background, so an actual color
|
|
||||||
// appears behind panes as we animate them sliding in.
|
|
||||||
_root.Background(s_unfocusedBorderBrush);
|
|
||||||
|
|
||||||
// Register an event with the control to have it inform us when it gains focus.
|
// Register an event with the control to have it inform us when it gains focus.
|
||||||
_gotFocusRevoker = _control.GotFocus(winrt::auto_revoke, { this, &Pane::_ControlGotFocusHandler });
|
_gotFocusRevoker = _control.GotFocus(winrt::auto_revoke, { this, &Pane::_ControlGotFocusHandler });
|
||||||
_lostFocusRevoker = _control.LostFocus(winrt::auto_revoke, { this, &Pane::_ControlLostFocusHandler });
|
_lostFocusRevoker = _control.LostFocus(winrt::auto_revoke, { this, &Pane::_ControlLostFocusHandler });
|
||||||
|
@ -1616,6 +1612,8 @@ winrt::fire_and_forget Pane::_CloseChildRoutine(const bool closeFirst)
|
||||||
// Create the dummy grid. This grid will be the one we actually animate,
|
// Create the dummy grid. This grid will be the one we actually animate,
|
||||||
// in the place of the closed pane.
|
// in the place of the closed pane.
|
||||||
Controls::Grid dummyGrid;
|
Controls::Grid dummyGrid;
|
||||||
|
// GH#603 - we can safely add a BG here, as the control is gone right
|
||||||
|
// away, to fill the space as the rest of the pane expands.
|
||||||
dummyGrid.Background(s_unfocusedBorderBrush);
|
dummyGrid.Background(s_unfocusedBorderBrush);
|
||||||
// It should be the size of the closed pane.
|
// It should be the size of the closed pane.
|
||||||
dummyGrid.Width(removedOriginalSize.Width);
|
dummyGrid.Width(removedOriginalSize.Width);
|
||||||
|
@ -1871,6 +1869,19 @@ void Pane::_SetupEntranceAnimation()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use the unfocused border color as the pane background, so an actual color
|
||||||
|
// appears behind panes as we animate them sliding in.
|
||||||
|
//
|
||||||
|
// GH#603 - We set only the background of the new pane, while it animates
|
||||||
|
// in. Once the animation is done, we'll remove that background, so if the
|
||||||
|
// user wants vintage opacity, they'll be able to see what's under the
|
||||||
|
// window.
|
||||||
|
// * If we don't give it a background, then the BG will be entirely transparent.
|
||||||
|
// * If we give the parent (us) root BG a color, then a transparent pane
|
||||||
|
// will flash opaque during the animation, then back to transparent, which
|
||||||
|
// looks bad.
|
||||||
|
_secondChild->_root.Background(s_unfocusedBorderBrush);
|
||||||
|
|
||||||
const auto [firstSize, secondSize] = _CalcChildrenSizes(::base::saturated_cast<float>(totalSize));
|
const auto [firstSize, secondSize] = _CalcChildrenSizes(::base::saturated_cast<float>(totalSize));
|
||||||
|
|
||||||
// This is safe to capture this, because it's only being called in the
|
// This is safe to capture this, because it's only being called in the
|
||||||
|
@ -1938,11 +1949,12 @@ void Pane::_SetupEntranceAnimation()
|
||||||
|
|
||||||
// When the animation is completed, undo the trickiness from before, to
|
// When the animation is completed, undo the trickiness from before, to
|
||||||
// restore the controls to the behavior they'd usually have.
|
// restore the controls to the behavior they'd usually have.
|
||||||
animation.Completed([childGrid, control](auto&&, auto&&) {
|
animation.Completed([childGrid, control, root = _secondChild->_root](auto&&, auto&&) {
|
||||||
control.Width(NAN);
|
control.Width(NAN);
|
||||||
childGrid.Width(NAN);
|
childGrid.Width(NAN);
|
||||||
childGrid.HorizontalAlignment(HorizontalAlignment::Stretch);
|
childGrid.HorizontalAlignment(HorizontalAlignment::Stretch);
|
||||||
control.HorizontalAlignment(HorizontalAlignment::Stretch);
|
control.HorizontalAlignment(HorizontalAlignment::Stretch);
|
||||||
|
root.Background(nullptr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1956,11 +1968,12 @@ void Pane::_SetupEntranceAnimation()
|
||||||
|
|
||||||
// When the animation is completed, undo the trickiness from before, to
|
// When the animation is completed, undo the trickiness from before, to
|
||||||
// restore the controls to the behavior they'd usually have.
|
// restore the controls to the behavior they'd usually have.
|
||||||
animation.Completed([childGrid, control](auto&&, auto&&) {
|
animation.Completed([childGrid, control, root = _secondChild->_root](auto&&, auto&&) {
|
||||||
control.Height(NAN);
|
control.Height(NAN);
|
||||||
childGrid.Height(NAN);
|
childGrid.Height(NAN);
|
||||||
childGrid.VerticalAlignment(VerticalAlignment::Stretch);
|
childGrid.VerticalAlignment(VerticalAlignment::Stretch);
|
||||||
control.VerticalAlignment(VerticalAlignment::Stretch);
|
control.VerticalAlignment(VerticalAlignment::Stretch);
|
||||||
|
root.Background(nullptr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace winrt::TerminalApp::implementation
|
||||||
TraceLoggingBool(usedManualProfile, "ProfileSpecified", "Whether the new tab specified a profile explicitly"),
|
TraceLoggingBool(usedManualProfile, "ProfileSpecified", "Whether the new tab specified a profile explicitly"),
|
||||||
TraceLoggingGuid(profile.Guid(), "ProfileGuid", "The GUID of the profile spawned in the new tab"),
|
TraceLoggingGuid(profile.Guid(), "ProfileGuid", "The GUID of the profile spawned in the new tab"),
|
||||||
TraceLoggingBool(settings.DefaultSettings().UseAcrylic(), "UseAcrylic", "The acrylic preference from the settings"),
|
TraceLoggingBool(settings.DefaultSettings().UseAcrylic(), "UseAcrylic", "The acrylic preference from the settings"),
|
||||||
TraceLoggingFloat64(settings.DefaultSettings().TintOpacity(), "TintOpacity", "Opacity preference from the settings"),
|
TraceLoggingFloat64(settings.DefaultSettings().Opacity(), "TintOpacity", "Opacity preference from the settings"),
|
||||||
TraceLoggingWideString(settings.DefaultSettings().FontFace().c_str(), "FontFace", "Font face chosen in the settings"),
|
TraceLoggingWideString(settings.DefaultSettings().FontFace().c_str(), "FontFace", "Font face chosen in the settings"),
|
||||||
TraceLoggingWideString(schemeName.data(), "SchemeName", "Color scheme set in the settings"),
|
TraceLoggingWideString(schemeName.data(), "SchemeName", "Color scheme set in the settings"),
|
||||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||||
|
|
|
@ -376,13 +376,14 @@
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<!-- ========================= Globals ======================== -->
|
<!-- ========================= Globals ======================== -->
|
||||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
|
||||||
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
xmlns:local="using:TerminalApp"
|
xmlns:local="using:TerminalApp"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
Background="Transparent"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid x:Name="Root"
|
<Grid x:Name="Root"
|
||||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
Background="Transparent">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
|
|
@ -1400,11 +1400,22 @@ namespace winrt::TerminalApp::implementation
|
||||||
deselectedTabBrush.Color(deselectedTabColor);
|
deselectedTabBrush.Color(deselectedTabColor);
|
||||||
|
|
||||||
// currently if a tab has a custom color, a deselected state is
|
// currently if a tab has a custom color, a deselected state is
|
||||||
// signified by using the same color with a bit ot transparency
|
// signified by using the same color with a bit of transparency
|
||||||
|
//
|
||||||
|
// Prior to MUX 2.7, we set TabViewItemHeaderBackground, but now we can
|
||||||
|
// use TabViewItem().Background() for that. HOWEVER,
|
||||||
|
// TabViewItem().Background() only sets the color of the tab background
|
||||||
|
// when the TabViewItem is unselected. So we still need to set the other
|
||||||
|
// properties ourselves.
|
||||||
|
TabViewItem().Background(deselectedTabBrush);
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundSelected"), selectedTabBrush);
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackground"), deselectedTabBrush);
|
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPointerOver"), hoverTabBrush);
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderBackgroundPressed"), selectedTabBrush);
|
||||||
|
|
||||||
|
// TabViewItem().Foreground() unfortunately does not work for us. It
|
||||||
|
// sets the color for the text when the TabViewItem isn't selected, but
|
||||||
|
// not when it is hovered, pressed, dragged, or selected, so we'll need
|
||||||
|
// to just set them all anyways.
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForeground"), fontBrush);
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundSelected"), fontBrush);
|
||||||
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
TabViewItem().Resources().Insert(winrt::box_value(L"TabViewItemHeaderForegroundPointerOver"), fontBrush);
|
||||||
|
@ -1442,7 +1453,6 @@ namespace winrt::TerminalApp::implementation
|
||||||
void TerminalTab::_ClearTabBackgroundColor()
|
void TerminalTab::_ClearTabBackgroundColor()
|
||||||
{
|
{
|
||||||
winrt::hstring keys[] = {
|
winrt::hstring keys[] = {
|
||||||
L"TabViewItemHeaderBackground",
|
|
||||||
L"TabViewItemHeaderBackgroundSelected",
|
L"TabViewItemHeaderBackgroundSelected",
|
||||||
L"TabViewItemHeaderBackgroundPointerOver",
|
L"TabViewItemHeaderBackgroundPointerOver",
|
||||||
L"TabViewItemHeaderForeground",
|
L"TabViewItemHeaderForeground",
|
||||||
|
@ -1463,6 +1473,9 @@ namespace winrt::TerminalApp::implementation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear out the Background.
|
||||||
|
TabViewItem().Background(nullptr);
|
||||||
|
|
||||||
_RefreshVisualState();
|
_RefreshVisualState();
|
||||||
_colorCleared();
|
_colorCleared();
|
||||||
}
|
}
|
||||||
|
@ -1487,7 +1500,7 @@ namespace winrt::TerminalApp::implementation
|
||||||
// - <none>
|
// - <none>
|
||||||
void TerminalTab::_RefreshVisualState()
|
void TerminalTab::_RefreshVisualState()
|
||||||
{
|
{
|
||||||
if (_focusState != FocusState::Unfocused)
|
if (TabViewItem().IsSelected())
|
||||||
{
|
{
|
||||||
VisualStateManager::GoToState(TabViewItem(), L"Normal", true);
|
VisualStateManager::GoToState(TabViewItem(), L"Normal", true);
|
||||||
VisualStateManager::GoToState(TabViewItem(), L"Selected", true);
|
VisualStateManager::GoToState(TabViewItem(), L"Selected", true);
|
||||||
|
|
|
@ -89,13 +89,13 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
#include "LibraryResources.h"
|
#include "LibraryResources.h"
|
||||||
|
|
||||||
using namespace ::Microsoft::Console;
|
using namespace ::Microsoft::Console;
|
||||||
|
using namespace std::string_view_literals;
|
||||||
|
|
||||||
|
// Format is: "DecimalResult (HexadecimalForm)"
|
||||||
|
static constexpr auto _errorFormat = L"{0} ({0:#010x})"sv;
|
||||||
|
|
||||||
// Notes:
|
// Notes:
|
||||||
// There is a number of ways that the Conpty connection can be terminated (voluntarily or not):
|
// There is a number of ways that the Conpty connection can be terminated (voluntarily or not):
|
||||||
|
@ -417,7 +421,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||||
const auto hr = wil::ResultFromCaughtException();
|
const auto hr = wil::ResultFromCaughtException();
|
||||||
|
|
||||||
winrt::hstring failureText{ fmt::format(std::wstring_view{ RS_(L"ProcessFailedToLaunch") },
|
winrt::hstring failureText{ fmt::format(std::wstring_view{ RS_(L"ProcessFailedToLaunch") },
|
||||||
gsl::narrow_cast<unsigned long>(hr),
|
fmt::format(_errorFormat, hr),
|
||||||
_commandline) };
|
_commandline) };
|
||||||
_TerminalOutputHandlers(failureText);
|
_TerminalOutputHandlers(failureText);
|
||||||
|
|
||||||
|
@ -444,7 +448,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
winrt::hstring exitText{ fmt::format(std::wstring_view{ RS_(L"ProcessExited") }, status) };
|
winrt::hstring exitText{ fmt::format(std::wstring_view{ RS_(L"ProcessExited") }, fmt::format(_errorFormat, status)) };
|
||||||
_TerminalOutputHandlers(L"\r\n");
|
_TerminalOutputHandlers(L"\r\n");
|
||||||
_TerminalOutputHandlers(exitText);
|
_TerminalOutputHandlers(exitText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,15 +205,15 @@
|
||||||
</data>
|
</data>
|
||||||
<data name="ProcessExited" xml:space="preserve">
|
<data name="ProcessExited" xml:space="preserve">
|
||||||
<value>[process exited with code {0}]</value>
|
<value>[process exited with code {0}]</value>
|
||||||
<comment>The first argument {0} is the (positive) error code of the process. When there is no error, the number ZERO will be displayed.</comment>
|
<comment>The first argument {0} is the error code of the process. When there is no error, the number ZERO will be displayed. </comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="ProcessFailedToLaunch" xml:space="preserve">
|
<data name="ProcessFailedToLaunch" xml:space="preserve">
|
||||||
<value>[error {0:#08x} when launching `{1}']</value>
|
<value>[error {0} when launching `{1}']</value>
|
||||||
<comment>The first argument {0...} is the hexadecimal error code. The second argument {1} is the user-specified path to a program.
|
<comment>The first argument {0} is the error code. The second argument {1} is the user-specified path to a program.
|
||||||
If this string is broken to multiple lines, it will not be displayed properly.</comment>
|
If this string is broken to multiple lines, it will not be displayed properly.</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="BadPathText" xml:space="preserve">
|
<data name="BadPathText" xml:space="preserve">
|
||||||
<value>Could not access starting directory "{0}"</value>
|
<value>Could not access starting directory "{0}"</value>
|
||||||
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
|
<comment>The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -56,7 +56,9 @@
|
||||||
<Midl Include="AzureConnection.idl" />
|
<Midl Include="AzureConnection.idl" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PRIResource Include="Resources\en-US\Resources.resw" />
|
<PRIResource Include="Resources\en-US\Resources.resw">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</PRIResource>
|
||||||
<OCResourceDirectory Include="Resources" />
|
<OCResourceDirectory Include="Resources" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -88,11 +90,11 @@
|
||||||
</Target>
|
</Target>
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<AdditionalIncludeDirectories>$(IntDir)..\OpenConsoleProxy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(IntDir)..\OpenConsoleProxy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalDependencies>$(OpenConsoleCommonOutDir)\conptylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>$(OpenConsoleCommonOutDir)\conptylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -32,6 +32,7 @@
|
||||||
<Midl Include="EchoConnection.idl" />
|
<Midl Include="EchoConnection.idl" />
|
||||||
<Midl Include="AzureConnection.idl" />
|
<Midl Include="AzureConnection.idl" />
|
||||||
<Midl Include="ConptyConnection.idl" />
|
<Midl Include="ConptyConnection.idl" />
|
||||||
|
<Midl Include="ConnectionInformation.idl" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
|
|
@ -276,7 +276,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
// GH#5098: Inform the engine of the opacity of the default text background.
|
// GH#5098: Inform the engine of the opacity of the default text background.
|
||||||
if (_settings.UseAcrylic())
|
if (_settings.UseAcrylic())
|
||||||
{
|
{
|
||||||
_renderEngine->SetDefaultTextBackgroundOpacity(::base::saturated_cast<float>(_settings.TintOpacity()));
|
_renderEngine->SetDefaultTextBackgroundOpacity(::base::saturated_cast<float>(_settings.Opacity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
THROW_IF_FAILED(_renderEngine->Enable());
|
THROW_IF_FAILED(_renderEngine->Enable());
|
||||||
|
@ -425,41 +425,17 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newOpacity = std::clamp(_settings.TintOpacity() + adjustment,
|
auto newOpacity = std::clamp(_settings.Opacity() + adjustment,
|
||||||
0.0,
|
0.0,
|
||||||
1.0);
|
1.0);
|
||||||
if (_settings.UseAcrylic())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_settings.TintOpacity(newOpacity);
|
|
||||||
|
|
||||||
if (newOpacity >= 1.0)
|
// GH#5098: Inform the engine of the new opacity of the default text background.
|
||||||
{
|
SetBackgroundOpacity(::base::saturated_cast<float>(newOpacity));
|
||||||
_settings.UseAcrylic(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// GH#5098: Inform the engine of the new opacity of the default text background.
|
|
||||||
SetBackgroundOpacity(::base::saturated_cast<float>(newOpacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
auto eventArgs = winrt::make_self<TransparencyChangedEventArgs>(newOpacity);
|
_settings.Opacity(newOpacity);
|
||||||
_TransparencyChangedHandlers(*this, *eventArgs);
|
|
||||||
}
|
|
||||||
CATCH_LOG();
|
|
||||||
}
|
|
||||||
else if (adjustment < 0)
|
|
||||||
{
|
|
||||||
_settings.UseAcrylic(true);
|
|
||||||
|
|
||||||
//Setting initial opacity set to 1 to ensure smooth transition to acrylic during mouse scroll
|
auto eventArgs = winrt::make_self<TransparencyChangedEventArgs>(newOpacity);
|
||||||
newOpacity = std::clamp(1.0 + adjustment, 0.0, 1.0);
|
_TransparencyChangedHandlers(*this, *eventArgs);
|
||||||
_settings.TintOpacity(newOpacity);
|
|
||||||
|
|
||||||
auto eventArgs = winrt::make_self<TransparencyChangedEventArgs>(newOpacity);
|
|
||||||
_TransparencyChangedHandlers(*this, *eventArgs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlCore::ToggleShaderEffects()
|
void ControlCore::ToggleShaderEffects()
|
||||||
|
@ -1003,6 +979,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
{
|
{
|
||||||
_terminal->WritePastedText(hstr);
|
_terminal->WritePastedText(hstr);
|
||||||
_terminal->ClearSelection();
|
_terminal->ClearSelection();
|
||||||
|
_renderer->TriggerSelection();
|
||||||
_terminal->TrySnapOnInput();
|
_terminal->TrySnapOnInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace Microsoft.Terminal.Control
|
||||||
Windows.UI.Xaml.VerticalAlignment BackgroundImageVerticalAlignment;
|
Windows.UI.Xaml.VerticalAlignment BackgroundImageVerticalAlignment;
|
||||||
Boolean IntenseIsBold;
|
Boolean IntenseIsBold;
|
||||||
// IntenseIsBright is in Core Appearance
|
// IntenseIsBright is in Core Appearance
|
||||||
|
Double Opacity;
|
||||||
|
|
||||||
// Experimental settings
|
// Experimental settings
|
||||||
Boolean RetroTerminalEffect;
|
Boolean RetroTerminalEffect;
|
||||||
|
|
|
@ -29,7 +29,6 @@ namespace Microsoft.Terminal.Control
|
||||||
String ProfileName;
|
String ProfileName;
|
||||||
|
|
||||||
Boolean UseAcrylic;
|
Boolean UseAcrylic;
|
||||||
Double TintOpacity;
|
|
||||||
ScrollbarState ScrollState;
|
ScrollbarState ScrollState;
|
||||||
|
|
||||||
String FontFace;
|
String FontFace;
|
||||||
|
|
|
@ -428,6 +428,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
// - <none>
|
// - <none>
|
||||||
void TermControl::_InitializeBackgroundBrush()
|
void TermControl::_InitializeBackgroundBrush()
|
||||||
{
|
{
|
||||||
|
auto appearance = _settings.try_as<IControlAppearance>();
|
||||||
if (_settings.UseAcrylic())
|
if (_settings.UseAcrylic())
|
||||||
{
|
{
|
||||||
// See if we've already got an acrylic background brush
|
// See if we've already got an acrylic background brush
|
||||||
|
@ -449,7 +450,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
acrylic.TintColor(bgColor);
|
acrylic.TintColor(bgColor);
|
||||||
|
|
||||||
// Apply brush settings
|
// Apply brush settings
|
||||||
acrylic.TintOpacity(_settings.TintOpacity());
|
acrylic.TintOpacity(appearance.Opacity());
|
||||||
|
|
||||||
// Apply brush to control if it's not already there
|
// Apply brush to control if it's not already there
|
||||||
if (RootGrid().Background() != acrylic)
|
if (RootGrid().Background() != acrylic)
|
||||||
|
@ -458,15 +459,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
// GH#5098: Inform the engine of the new opacity of the default text background.
|
// GH#5098: Inform the engine of the new opacity of the default text background.
|
||||||
_core.SetBackgroundOpacity(::base::saturated_cast<float>(_settings.TintOpacity()));
|
_core.SetBackgroundOpacity(::base::saturated_cast<float>(appearance.Opacity()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Media::SolidColorBrush solidColor{};
|
Media::SolidColorBrush solidColor{};
|
||||||
|
solidColor.Opacity(_settings.Opacity());
|
||||||
RootGrid().Background(solidColor);
|
RootGrid().Background(solidColor);
|
||||||
|
|
||||||
// GH#5098: Inform the engine of the new opacity of the default text background.
|
// GH#5098: Inform the engine of the new opacity of the default text background.
|
||||||
_core.SetBackgroundOpacity(1.0f);
|
_core.SetBackgroundOpacity(appearance.Opacity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -497,7 +499,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
}
|
}
|
||||||
else if (auto solidColor = RootGrid().Background().try_as<Media::SolidColorBrush>())
|
else if (auto solidColor = RootGrid().Background().try_as<Media::SolidColorBrush>())
|
||||||
{
|
{
|
||||||
|
const auto originalOpacity = solidColor.Opacity();
|
||||||
solidColor.Color(bg);
|
solidColor.Color(bg);
|
||||||
|
solidColor.Opacity(originalOpacity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
d:DesignWidth="1024"
|
d:DesignWidth="1024"
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
AllowFocusOnInteraction="True"
|
AllowFocusOnInteraction="True"
|
||||||
|
Background="Transparent"
|
||||||
CharacterReceived="_CharacterHandler"
|
CharacterReceived="_CharacterHandler"
|
||||||
DragOver="_DragOverHandler"
|
DragOver="_DragOverHandler"
|
||||||
Drop="_DragDropHandler"
|
Drop="_DragDropHandler"
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||||
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
|
|
|
@ -312,12 +312,12 @@
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -22,7 +22,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||||
|
|
||||||
void SetAcrylicOpacityPercentageValue(double value)
|
void SetAcrylicOpacityPercentageValue(double value)
|
||||||
{
|
{
|
||||||
AcrylicOpacity(winrt::Microsoft::Terminal::Settings::Editor::Converters::PercentageValueToPercentage(value));
|
_profile.DefaultAppearance().Opacity(winrt::Microsoft::Terminal::Settings::Editor::Converters::PercentageValueToPercentage(value));
|
||||||
};
|
};
|
||||||
|
|
||||||
void SetPadding(double value)
|
void SetPadding(double value)
|
||||||
|
@ -66,7 +66,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, TabColor);
|
OBSERVABLE_PROJECTED_SETTING(_profile, TabColor);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, SuppressApplicationTitle);
|
OBSERVABLE_PROJECTED_SETTING(_profile, SuppressApplicationTitle);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, UseAcrylic);
|
OBSERVABLE_PROJECTED_SETTING(_profile, UseAcrylic);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, AcrylicOpacity);
|
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, ScrollState);
|
OBSERVABLE_PROJECTED_SETTING(_profile, ScrollState);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, Padding);
|
OBSERVABLE_PROJECTED_SETTING(_profile, Padding);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, Commandline);
|
OBSERVABLE_PROJECTED_SETTING(_profile, Commandline);
|
||||||
|
@ -78,6 +77,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), Background);
|
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), Background);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), SelectionBackground);
|
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), SelectionBackground);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), CursorColor);
|
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), CursorColor);
|
||||||
|
OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), Opacity);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, HistorySize);
|
OBSERVABLE_PROJECTED_SETTING(_profile, HistorySize);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, SnapOnInput);
|
OBSERVABLE_PROJECTED_SETTING(_profile, SnapOnInput);
|
||||||
OBSERVABLE_PROJECTED_SETTING(_profile, AltGrAliasing);
|
OBSERVABLE_PROJECTED_SETTING(_profile, AltGrAliasing);
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, UseAcrylic);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, UseAcrylic);
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Double, AcrylicOpacity);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(Double, Opacity);
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Padding);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Padding);
|
||||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Commandline);
|
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Commandline);
|
||||||
|
@ -109,6 +109,6 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||||
IInspectable CurrentScrollState;
|
IInspectable CurrentScrollState;
|
||||||
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> ScrollStateList { get; };
|
Windows.Foundation.Collections.IObservableVector<Microsoft.Terminal.Settings.Editor.EnumEntry> ScrollStateList { get; };
|
||||||
|
|
||||||
Windows.UI.Xaml.Controls.Slider AcrylicOpacitySlider { get; };
|
Windows.UI.Xaml.Controls.Slider OpacitySlider { get; };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,11 +238,33 @@
|
||||||
<local:Appearances Appearance="{x:Bind State.Profile.DefaultAppearance, Mode=OneWay}"
|
<local:Appearances Appearance="{x:Bind State.Profile.DefaultAppearance, Mode=OneWay}"
|
||||||
SourceProfile="{x:Bind State.Profile, Mode=OneWay}" />
|
SourceProfile="{x:Bind State.Profile, Mode=OneWay}" />
|
||||||
|
|
||||||
<!-- Grouping: Acrylic -->
|
<!-- Grouping: Transparency -->
|
||||||
<StackPanel Style="{StaticResource PivotStackStyle}">
|
<StackPanel Style="{StaticResource PivotStackStyle}">
|
||||||
<TextBlock x:Uid="Profile_AcrylicHeader"
|
<TextBlock x:Uid="Profile_TransparencyHeader"
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}" />
|
Style="{StaticResource SubtitleTextBlockStyle}" />
|
||||||
|
|
||||||
|
<!-- Opacity -->
|
||||||
|
<local:SettingContainer x:Name="OpacityContainer"
|
||||||
|
x:Uid="Profile_Opacity"
|
||||||
|
ClearSettingValue="{x:Bind State.Profile.ClearOpacity}"
|
||||||
|
HasSettingValue="{x:Bind State.Profile.HasOpacity, Mode=OneWay}"
|
||||||
|
SettingOverrideSource="{x:Bind State.Profile.OpacityOverrideSource, Mode=OneWay}">
|
||||||
|
<StackPanel x:Name="OpacityControl">
|
||||||
|
<Grid Style="{StaticResource CustomSliderControlGridStyle}">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Slider x:Name="OpacitySlider"
|
||||||
|
Grid.Column="0"
|
||||||
|
Value="{x:Bind local:Converters.PercentageToPercentageValue(State.Profile.Opacity), BindBack=State.Profile.SetAcrylicOpacityPercentageValue, Mode=TwoWay}" />
|
||||||
|
<TextBlock Grid.Column="1"
|
||||||
|
Style="{StaticResource SliderValueLabelStyle}"
|
||||||
|
Text="{x:Bind local:Converters.AppendPercentageSign(OpacitySlider.Value), Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</local:SettingContainer>
|
||||||
|
|
||||||
<!-- Use Acrylic -->
|
<!-- Use Acrylic -->
|
||||||
<local:SettingContainer x:Uid="Profile_UseAcrylic"
|
<local:SettingContainer x:Uid="Profile_UseAcrylic"
|
||||||
Margin="0"
|
Margin="0"
|
||||||
|
@ -253,28 +275,6 @@
|
||||||
IsOn="{x:Bind State.Profile.UseAcrylic, Mode=TwoWay}" />
|
IsOn="{x:Bind State.Profile.UseAcrylic, Mode=TwoWay}" />
|
||||||
</local:SettingContainer>
|
</local:SettingContainer>
|
||||||
|
|
||||||
<!-- Acrylic Opacity -->
|
|
||||||
<local:SettingContainer x:Name="AcrylicOpacityContainer"
|
|
||||||
x:Uid="Profile_AcrylicOpacity"
|
|
||||||
ClearSettingValue="{x:Bind State.Profile.ClearAcrylicOpacity}"
|
|
||||||
HasSettingValue="{x:Bind State.Profile.HasAcrylicOpacity, Mode=OneWay}"
|
|
||||||
SettingOverrideSource="{x:Bind State.Profile.AcrylicOpacityOverrideSource, Mode=OneWay}"
|
|
||||||
Visibility="{Binding ElementName=UseAcrylicToggleSwitch, Path=IsOn, Mode=OneWay}">
|
|
||||||
<StackPanel x:Name="AcrylicOpacityControl">
|
|
||||||
<Grid Style="{StaticResource CustomSliderControlGridStyle}">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="Auto" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Slider x:Name="AcrylicOpacitySlider"
|
|
||||||
Grid.Column="0"
|
|
||||||
Value="{x:Bind local:Converters.PercentageToPercentageValue(State.Profile.AcrylicOpacity), BindBack=State.Profile.SetAcrylicOpacityPercentageValue, Mode=TwoWay}" />
|
|
||||||
<TextBlock Grid.Column="1"
|
|
||||||
Style="{StaticResource SliderValueLabelStyle}"
|
|
||||||
Text="{x:Bind local:Converters.AppendPercentageSign(AcrylicOpacitySlider.Value), Mode=OneWay}" />
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</local:SettingContainer>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Grouping: Window -->
|
<!-- Grouping: Window -->
|
||||||
|
|
|
@ -495,6 +495,14 @@
|
||||||
<value>Sets the transparency of the window.</value>
|
<value>Sets the transparency of the window.</value>
|
||||||
<comment>A description for what the "acrylic opacity" setting does. Presented near "Profile_AcrylicOpacity.Header".</comment>
|
<comment>A description for what the "acrylic opacity" setting does. Presented near "Profile_AcrylicOpacity.Header".</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Profile_Opacity.Header" xml:space="preserve">
|
||||||
|
<value>Background Opacity</value>
|
||||||
|
<comment>Header for a control to determine the level of opacity for the background of the control. The user can choose to make the background of the app more or less opaque.</comment>
|
||||||
|
</data>
|
||||||
|
<data name="Profile_Opacity.HelpText" xml:space="preserve">
|
||||||
|
<value>Sets the transparency of the window.</value>
|
||||||
|
<comment>A description for what the "opacity" setting does. Presented near "Profile_Opacity.Header".</comment>
|
||||||
|
</data>
|
||||||
<data name="Profile_Advanced.Header" xml:space="preserve">
|
<data name="Profile_Advanced.Header" xml:space="preserve">
|
||||||
<value>Advanced</value>
|
<value>Advanced</value>
|
||||||
<comment>Header for a sub-page of profile settings focused on more advanced scenarios.</comment>
|
<comment>Header for a sub-page of profile settings focused on more advanced scenarios.</comment>
|
||||||
|
@ -986,6 +994,10 @@
|
||||||
<value>Acrylic</value>
|
<value>Acrylic</value>
|
||||||
<comment>Header for a group of settings related to the acrylic texture rendering on the background of the app.</comment>
|
<comment>Header for a group of settings related to the acrylic texture rendering on the background of the app.</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Profile_TransparencyHeader.Text" xml:space="preserve">
|
||||||
|
<value>Transparency</value>
|
||||||
|
<comment>Header for a group of settings related to transparency, including the acrylic texture rendering on the background of the app.</comment>
|
||||||
|
</data>
|
||||||
<data name="Profile_BackgroundHeader.Text" xml:space="preserve">
|
<data name="Profile_BackgroundHeader.Text" xml:space="preserve">
|
||||||
<value>Background image</value>
|
<value>Background image</value>
|
||||||
<comment>Header for a group of settings that control the image presented on the background of the app. Presented near "Profile_BackgroundImage" and other keys starting with "Profile_BackgroundImage".</comment>
|
<comment>Header for a group of settings that control the image presented on the background of the app. Presented near "Profile_BackgroundImage" and other keys starting with "Profile_BackgroundImage".</comment>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
|
@ -26,6 +26,8 @@ static constexpr std::string_view BackgroundImageAlignmentKey{ "backgroundImageA
|
||||||
static constexpr std::string_view RetroTerminalEffectKey{ "experimental.retroTerminalEffect" };
|
static constexpr std::string_view RetroTerminalEffectKey{ "experimental.retroTerminalEffect" };
|
||||||
static constexpr std::string_view PixelShaderPathKey{ "experimental.pixelShaderPath" };
|
static constexpr std::string_view PixelShaderPathKey{ "experimental.pixelShaderPath" };
|
||||||
static constexpr std::string_view IntenseTextStyleKey{ "intenseTextStyle" };
|
static constexpr std::string_view IntenseTextStyleKey{ "intenseTextStyle" };
|
||||||
|
static constexpr std::string_view LegacyAcrylicTransparencyKey{ "acrylicOpacity" };
|
||||||
|
static constexpr std::string_view OpacityKey{ "opacity" };
|
||||||
|
|
||||||
winrt::Microsoft::Terminal::Settings::Model::implementation::AppearanceConfig::AppearanceConfig(const winrt::weak_ref<Profile> sourceProfile) :
|
winrt::Microsoft::Terminal::Settings::Model::implementation::AppearanceConfig::AppearanceConfig(const winrt::weak_ref<Profile> sourceProfile) :
|
||||||
_sourceProfile(sourceProfile)
|
_sourceProfile(sourceProfile)
|
||||||
|
@ -50,6 +52,7 @@ winrt::com_ptr<AppearanceConfig> AppearanceConfig::CopyAppearance(const winrt::c
|
||||||
appearance->_RetroTerminalEffect = sourceAppearance->_RetroTerminalEffect;
|
appearance->_RetroTerminalEffect = sourceAppearance->_RetroTerminalEffect;
|
||||||
appearance->_PixelShaderPath = sourceAppearance->_PixelShaderPath;
|
appearance->_PixelShaderPath = sourceAppearance->_PixelShaderPath;
|
||||||
appearance->_IntenseTextStyle = sourceAppearance->_IntenseTextStyle;
|
appearance->_IntenseTextStyle = sourceAppearance->_IntenseTextStyle;
|
||||||
|
appearance->_Opacity = sourceAppearance->_Opacity;
|
||||||
return appearance;
|
return appearance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +74,7 @@ Json::Value AppearanceConfig::ToJson() const
|
||||||
JsonUtils::SetValueForKey(json, RetroTerminalEffectKey, _RetroTerminalEffect);
|
JsonUtils::SetValueForKey(json, RetroTerminalEffectKey, _RetroTerminalEffect);
|
||||||
JsonUtils::SetValueForKey(json, PixelShaderPathKey, _PixelShaderPath);
|
JsonUtils::SetValueForKey(json, PixelShaderPathKey, _PixelShaderPath);
|
||||||
JsonUtils::SetValueForKey(json, IntenseTextStyleKey, _IntenseTextStyle);
|
JsonUtils::SetValueForKey(json, IntenseTextStyleKey, _IntenseTextStyle);
|
||||||
|
JsonUtils::SetValueForKey(json, OpacityKey, _Opacity, JsonUtils::OptionalConverter<double, IntAsFloatPercentConversionTrait>{});
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
@ -102,6 +106,8 @@ void AppearanceConfig::LayerJson(const Json::Value& json)
|
||||||
JsonUtils::GetValueForKey(json, RetroTerminalEffectKey, _RetroTerminalEffect);
|
JsonUtils::GetValueForKey(json, RetroTerminalEffectKey, _RetroTerminalEffect);
|
||||||
JsonUtils::GetValueForKey(json, PixelShaderPathKey, _PixelShaderPath);
|
JsonUtils::GetValueForKey(json, PixelShaderPathKey, _PixelShaderPath);
|
||||||
JsonUtils::GetValueForKey(json, IntenseTextStyleKey, _IntenseTextStyle);
|
JsonUtils::GetValueForKey(json, IntenseTextStyleKey, _IntenseTextStyle);
|
||||||
|
JsonUtils::GetValueForKey(json, LegacyAcrylicTransparencyKey, _Opacity);
|
||||||
|
JsonUtils::GetValueForKey(json, OpacityKey, _Opacity, JsonUtils::OptionalConverter<double, IntAsFloatPercentConversionTrait>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
winrt::Microsoft::Terminal::Settings::Model::Profile AppearanceConfig::SourceProfile()
|
winrt::Microsoft::Terminal::Settings::Model::Profile AppearanceConfig::SourceProfile()
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
INHERITABLE_SETTING(Model::IAppearanceConfig, bool, RetroTerminalEffect, false);
|
INHERITABLE_SETTING(Model::IAppearanceConfig, bool, RetroTerminalEffect, false);
|
||||||
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, PixelShaderPath, L"");
|
INHERITABLE_SETTING(Model::IAppearanceConfig, hstring, PixelShaderPath, L"");
|
||||||
INHERITABLE_SETTING(Model::IAppearanceConfig, Model::IntenseStyle, IntenseTextStyle, Model::IntenseStyle::Bright);
|
INHERITABLE_SETTING(Model::IAppearanceConfig, Model::IntenseStyle, IntenseTextStyle, Model::IntenseStyle::Bright);
|
||||||
|
INHERITABLE_SETTING(Model::IAppearanceConfig, double, Opacity, 1.0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
winrt::weak_ref<Profile> _sourceProfile;
|
winrt::weak_ref<Profile> _sourceProfile;
|
||||||
|
|
|
@ -307,7 +307,6 @@ winrt::Microsoft::Terminal::Settings::Model::Profile CascadiaSettings::Duplicate
|
||||||
DUPLICATE_SETTING_MACRO(TabColor);
|
DUPLICATE_SETTING_MACRO(TabColor);
|
||||||
DUPLICATE_SETTING_MACRO(SuppressApplicationTitle);
|
DUPLICATE_SETTING_MACRO(SuppressApplicationTitle);
|
||||||
DUPLICATE_SETTING_MACRO(UseAcrylic);
|
DUPLICATE_SETTING_MACRO(UseAcrylic);
|
||||||
DUPLICATE_SETTING_MACRO(AcrylicOpacity);
|
|
||||||
DUPLICATE_SETTING_MACRO(ScrollState);
|
DUPLICATE_SETTING_MACRO(ScrollState);
|
||||||
DUPLICATE_SETTING_MACRO(Padding);
|
DUPLICATE_SETTING_MACRO(Padding);
|
||||||
DUPLICATE_SETTING_MACRO(Commandline);
|
DUPLICATE_SETTING_MACRO(Commandline);
|
||||||
|
@ -347,6 +346,7 @@ winrt::Microsoft::Terminal::Settings::Model::Profile CascadiaSettings::Duplicate
|
||||||
DUPLICATE_SETTING_MACRO_SUB(appearance, target, RetroTerminalEffect);
|
DUPLICATE_SETTING_MACRO_SUB(appearance, target, RetroTerminalEffect);
|
||||||
DUPLICATE_SETTING_MACRO_SUB(appearance, target, CursorShape);
|
DUPLICATE_SETTING_MACRO_SUB(appearance, target, CursorShape);
|
||||||
DUPLICATE_SETTING_MACRO_SUB(appearance, target, CursorHeight);
|
DUPLICATE_SETTING_MACRO_SUB(appearance, target, CursorHeight);
|
||||||
|
DUPLICATE_SETTING_MACRO_SUB(appearance, target, Opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnfocusedAppearance is treated as a single setting,
|
// UnfocusedAppearance is treated as a single setting,
|
||||||
|
|
|
@ -51,5 +51,6 @@ namespace Microsoft.Terminal.Settings.Model
|
||||||
INHERITABLE_APPEARANCE_SETTING(Boolean, RetroTerminalEffect);
|
INHERITABLE_APPEARANCE_SETTING(Boolean, RetroTerminalEffect);
|
||||||
INHERITABLE_APPEARANCE_SETTING(String, PixelShaderPath);
|
INHERITABLE_APPEARANCE_SETTING(String, PixelShaderPath);
|
||||||
INHERITABLE_APPEARANCE_SETTING(IntenseStyle, IntenseTextStyle);
|
INHERITABLE_APPEARANCE_SETTING(IntenseStyle, IntenseTextStyle);
|
||||||
|
INHERITABLE_APPEARANCE_SETTING(Double, Opacity);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,12 +241,13 @@
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<!-- ========================= Globals ======================== -->
|
<!-- ========================= Globals ======================== -->
|
||||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
|
||||||
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Native.2.3.2262\build\native\Microsoft.VisualStudio.Setup.Configuration.Native.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- This target will take our defaults.json and stamp it into a .h file that
|
<!-- This target will take our defaults.json and stamp it into a .h file that
|
||||||
|
|
|
@ -36,7 +36,6 @@ static constexpr std::string_view AltGrAliasingKey{ "altGrAliasing" };
|
||||||
static constexpr std::string_view ConnectionTypeKey{ "connectionType" };
|
static constexpr std::string_view ConnectionTypeKey{ "connectionType" };
|
||||||
static constexpr std::string_view CommandlineKey{ "commandline" };
|
static constexpr std::string_view CommandlineKey{ "commandline" };
|
||||||
static constexpr std::string_view FontInfoKey{ "font" };
|
static constexpr std::string_view FontInfoKey{ "font" };
|
||||||
static constexpr std::string_view AcrylicTransparencyKey{ "acrylicOpacity" };
|
|
||||||
static constexpr std::string_view UseAcrylicKey{ "useAcrylic" };
|
static constexpr std::string_view UseAcrylicKey{ "useAcrylic" };
|
||||||
static constexpr std::string_view ScrollbarStateKey{ "scrollbarState" };
|
static constexpr std::string_view ScrollbarStateKey{ "scrollbarState" };
|
||||||
static constexpr std::string_view CloseOnExitKey{ "closeOnExit" };
|
static constexpr std::string_view CloseOnExitKey{ "closeOnExit" };
|
||||||
|
@ -95,7 +94,6 @@ winrt::com_ptr<Profile> Profile::CopySettings(winrt::com_ptr<Profile> source)
|
||||||
profile->_TabColor = source->_TabColor;
|
profile->_TabColor = source->_TabColor;
|
||||||
profile->_SuppressApplicationTitle = source->_SuppressApplicationTitle;
|
profile->_SuppressApplicationTitle = source->_SuppressApplicationTitle;
|
||||||
profile->_UseAcrylic = source->_UseAcrylic;
|
profile->_UseAcrylic = source->_UseAcrylic;
|
||||||
profile->_AcrylicOpacity = source->_AcrylicOpacity;
|
|
||||||
profile->_ScrollState = source->_ScrollState;
|
profile->_ScrollState = source->_ScrollState;
|
||||||
profile->_Padding = source->_Padding;
|
profile->_Padding = source->_Padding;
|
||||||
profile->_Commandline = source->_Commandline;
|
profile->_Commandline = source->_Commandline;
|
||||||
|
@ -356,7 +354,6 @@ void Profile::LayerJson(const Json::Value& json)
|
||||||
// Control Settings
|
// Control Settings
|
||||||
JsonUtils::GetValueForKey(json, ConnectionTypeKey, _ConnectionType);
|
JsonUtils::GetValueForKey(json, ConnectionTypeKey, _ConnectionType);
|
||||||
JsonUtils::GetValueForKey(json, CommandlineKey, _Commandline);
|
JsonUtils::GetValueForKey(json, CommandlineKey, _Commandline);
|
||||||
JsonUtils::GetValueForKey(json, AcrylicTransparencyKey, _AcrylicOpacity);
|
|
||||||
JsonUtils::GetValueForKey(json, UseAcrylicKey, _UseAcrylic);
|
JsonUtils::GetValueForKey(json, UseAcrylicKey, _UseAcrylic);
|
||||||
JsonUtils::GetValueForKey(json, SuppressApplicationTitleKey, _SuppressApplicationTitle);
|
JsonUtils::GetValueForKey(json, SuppressApplicationTitleKey, _SuppressApplicationTitle);
|
||||||
JsonUtils::GetValueForKey(json, CloseOnExitKey, _CloseOnExit);
|
JsonUtils::GetValueForKey(json, CloseOnExitKey, _CloseOnExit);
|
||||||
|
@ -548,7 +545,6 @@ Json::Value Profile::ToJson() const
|
||||||
// Control Settings
|
// Control Settings
|
||||||
JsonUtils::SetValueForKey(json, ConnectionTypeKey, _ConnectionType);
|
JsonUtils::SetValueForKey(json, ConnectionTypeKey, _ConnectionType);
|
||||||
JsonUtils::SetValueForKey(json, CommandlineKey, _Commandline);
|
JsonUtils::SetValueForKey(json, CommandlineKey, _Commandline);
|
||||||
JsonUtils::SetValueForKey(json, AcrylicTransparencyKey, _AcrylicOpacity);
|
|
||||||
JsonUtils::SetValueForKey(json, UseAcrylicKey, _UseAcrylic);
|
JsonUtils::SetValueForKey(json, UseAcrylicKey, _UseAcrylic);
|
||||||
JsonUtils::SetValueForKey(json, SuppressApplicationTitleKey, _SuppressApplicationTitle);
|
JsonUtils::SetValueForKey(json, SuppressApplicationTitleKey, _SuppressApplicationTitle);
|
||||||
JsonUtils::SetValueForKey(json, CloseOnExitKey, _CloseOnExit);
|
JsonUtils::SetValueForKey(json, CloseOnExitKey, _CloseOnExit);
|
||||||
|
|
|
@ -67,7 +67,6 @@ namespace Microsoft.Terminal.Settings.Model
|
||||||
INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
|
INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
|
||||||
INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
|
INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
|
||||||
INHERITABLE_PROFILE_SETTING(Boolean, UseAcrylic);
|
INHERITABLE_PROFILE_SETTING(Boolean, UseAcrylic);
|
||||||
INHERITABLE_PROFILE_SETTING(Double, AcrylicOpacity);
|
|
||||||
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
|
INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
|
||||||
INHERITABLE_PROFILE_SETTING(String, Padding);
|
INHERITABLE_PROFILE_SETTING(String, Padding);
|
||||||
INHERITABLE_PROFILE_SETTING(String, Commandline);
|
INHERITABLE_PROFILE_SETTING(String, Commandline);
|
||||||
|
|
|
@ -201,6 +201,16 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
|
|
||||||
_IntenseIsBold = WI_IsFlagSet(appearance.IntenseTextStyle(), Microsoft::Terminal::Settings::Model::IntenseStyle::Bold);
|
_IntenseIsBold = WI_IsFlagSet(appearance.IntenseTextStyle(), Microsoft::Terminal::Settings::Model::IntenseStyle::Bold);
|
||||||
_IntenseIsBright = WI_IsFlagSet(appearance.IntenseTextStyle(), Microsoft::Terminal::Settings::Model::IntenseStyle::Bright);
|
_IntenseIsBright = WI_IsFlagSet(appearance.IntenseTextStyle(), Microsoft::Terminal::Settings::Model::IntenseStyle::Bright);
|
||||||
|
|
||||||
|
// If the user set an opacity, then just use that. Otherwise, change the
|
||||||
|
// default value based off of whether useAcrylic was set or not. If they
|
||||||
|
// want acrylic, then default to 50%. Otherwise, default to 100% (fully
|
||||||
|
// opaque)
|
||||||
|
_Opacity = appearance.HasOpacity() ?
|
||||||
|
appearance.Opacity() :
|
||||||
|
UseAcrylic() ?
|
||||||
|
.5 :
|
||||||
|
1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
|
@ -273,7 +283,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
// Fill in the remaining properties from the profile
|
// Fill in the remaining properties from the profile
|
||||||
_ProfileName = profile.Name();
|
_ProfileName = profile.Name();
|
||||||
_UseAcrylic = profile.UseAcrylic();
|
_UseAcrylic = profile.UseAcrylic();
|
||||||
_TintOpacity = profile.AcrylicOpacity();
|
|
||||||
|
|
||||||
_FontFace = profile.FontInfo().FontFace();
|
_FontFace = profile.FontInfo().FontFace();
|
||||||
_FontSize = profile.FontInfo().FontSize();
|
_FontSize = profile.FontInfo().FontSize();
|
||||||
|
|
|
@ -118,7 +118,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
|
|
||||||
INHERITABLE_SETTING(Model::TerminalSettings, hstring, ProfileName);
|
INHERITABLE_SETTING(Model::TerminalSettings, hstring, ProfileName);
|
||||||
INHERITABLE_SETTING(Model::TerminalSettings, bool, UseAcrylic, false);
|
INHERITABLE_SETTING(Model::TerminalSettings, bool, UseAcrylic, false);
|
||||||
INHERITABLE_SETTING(Model::TerminalSettings, double, TintOpacity, 0.5);
|
INHERITABLE_SETTING(Model::TerminalSettings, double, Opacity, UseAcrylic() ? 0.5 : 1.0);
|
||||||
INHERITABLE_SETTING(Model::TerminalSettings, hstring, Padding, DEFAULT_PADDING);
|
INHERITABLE_SETTING(Model::TerminalSettings, hstring, Padding, DEFAULT_PADDING);
|
||||||
INHERITABLE_SETTING(Model::TerminalSettings, hstring, FontFace, DEFAULT_FONT_FACE);
|
INHERITABLE_SETTING(Model::TerminalSettings, hstring, FontFace, DEFAULT_FONT_FACE);
|
||||||
INHERITABLE_SETTING(Model::TerminalSettings, int32_t, FontSize, DEFAULT_FONT_SIZE);
|
INHERITABLE_SETTING(Model::TerminalSettings, int32_t, FontSize, DEFAULT_FONT_SIZE);
|
||||||
|
|
|
@ -342,6 +342,34 @@ struct ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<::winr
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct IntAsFloatPercentConversionTrait : ::Microsoft::Terminal::Settings::Model::JsonUtils::ConversionTrait<double>
|
||||||
|
{
|
||||||
|
double FromJson(const Json::Value& json)
|
||||||
|
{
|
||||||
|
return ::base::saturated_cast<double>(json.asUInt()) / 100.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CanConvert(const Json::Value& json)
|
||||||
|
{
|
||||||
|
if (!json.isUInt())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const auto value = json.asUInt();
|
||||||
|
return value >= 0 && value <= 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::Value ToJson(const double& val)
|
||||||
|
{
|
||||||
|
return std::clamp(::base::saturated_cast<uint32_t>(std::round(val * 100.0)), 0u, 100u);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string TypeDescription() const
|
||||||
|
{
|
||||||
|
return "number (>= 0, <=100)";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Possible FocusDirection values
|
// Possible FocusDirection values
|
||||||
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::FocusDirection)
|
JSON_ENUM_MAPPER(::winrt::Microsoft::Terminal::Settings::Model::FocusDirection)
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,12 +101,12 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(OpenConsoleDir)\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace ControlUnitTests
|
||||||
auto [settings, conn] = _createSettingsAndConnection();
|
auto [settings, conn] = _createSettingsAndConnection();
|
||||||
|
|
||||||
settings->UseAcrylic(true);
|
settings->UseAcrylic(true);
|
||||||
settings->TintOpacity(0.5f);
|
settings->Opacity(0.5f);
|
||||||
|
|
||||||
auto core = createCore(*settings, *conn);
|
auto core = createCore(*settings, *conn);
|
||||||
VERIFY_IS_NOT_NULL(core);
|
VERIFY_IS_NOT_NULL(core);
|
||||||
|
@ -128,16 +128,19 @@ namespace ControlUnitTests
|
||||||
double expectedOpacity = 0.5;
|
double expectedOpacity = 0.5;
|
||||||
auto opacityCallback = [&](auto&&, Control::TransparencyChangedEventArgs args) mutable {
|
auto opacityCallback = [&](auto&&, Control::TransparencyChangedEventArgs args) mutable {
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity, args.Opacity());
|
VERIFY_ARE_EQUAL(expectedOpacity, args.Opacity());
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity, settings->TintOpacity());
|
VERIFY_ARE_EQUAL(expectedOpacity, settings->Opacity());
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity, core->_settings.TintOpacity());
|
VERIFY_ARE_EQUAL(expectedOpacity, core->_settings.Opacity());
|
||||||
|
|
||||||
if (expectedOpacity < 1.0)
|
if (expectedOpacity < 1.0)
|
||||||
{
|
{
|
||||||
VERIFY_IS_TRUE(settings->UseAcrylic());
|
VERIFY_IS_TRUE(settings->UseAcrylic());
|
||||||
VERIFY_IS_TRUE(core->_settings.UseAcrylic());
|
VERIFY_IS_TRUE(core->_settings.UseAcrylic());
|
||||||
}
|
}
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity < 1.0, settings->UseAcrylic());
|
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity < 1.0, core->_settings.UseAcrylic());
|
// GH#603: Adjusting opacity shouldn't change whether or not we
|
||||||
|
// requested acrylic.
|
||||||
|
VERIFY_IS_TRUE(settings->UseAcrylic());
|
||||||
|
VERIFY_IS_TRUE(core->_settings.UseAcrylic());
|
||||||
};
|
};
|
||||||
core->TransparencyChanged(opacityCallback);
|
core->TransparencyChanged(opacityCallback);
|
||||||
|
|
||||||
|
@ -220,7 +223,7 @@ namespace ControlUnitTests
|
||||||
{
|
{
|
||||||
auto [settings, conn] = _createSettingsAndConnection();
|
auto [settings, conn] = _createSettingsAndConnection();
|
||||||
Log::Comment(L"Create ControlCore object");
|
Log::Comment(L"Create ControlCore object");
|
||||||
auto core = winrt::make_self<Control::implementation::ControlCore>(*settings, *conn);
|
auto core = createCore(*settings, *conn);
|
||||||
VERIFY_IS_NOT_NULL(core);
|
VERIFY_IS_NOT_NULL(core);
|
||||||
_standardInit(core);
|
_standardInit(core);
|
||||||
|
|
||||||
|
@ -259,7 +262,7 @@ namespace ControlUnitTests
|
||||||
{
|
{
|
||||||
auto [settings, conn] = _createSettingsAndConnection();
|
auto [settings, conn] = _createSettingsAndConnection();
|
||||||
Log::Comment(L"Create ControlCore object");
|
Log::Comment(L"Create ControlCore object");
|
||||||
auto core = winrt::make_self<Control::implementation::ControlCore>(*settings, *conn);
|
auto core = createCore(*settings, *conn);
|
||||||
VERIFY_IS_NOT_NULL(core);
|
VERIFY_IS_NOT_NULL(core);
|
||||||
_standardInit(core);
|
_standardInit(core);
|
||||||
|
|
||||||
|
@ -298,7 +301,7 @@ namespace ControlUnitTests
|
||||||
{
|
{
|
||||||
auto [settings, conn] = _createSettingsAndConnection();
|
auto [settings, conn] = _createSettingsAndConnection();
|
||||||
Log::Comment(L"Create ControlCore object");
|
Log::Comment(L"Create ControlCore object");
|
||||||
auto core = winrt::make_self<Control::implementation::ControlCore>(*settings, *conn);
|
auto core = createCore(*settings, *conn);
|
||||||
VERIFY_IS_NOT_NULL(core);
|
VERIFY_IS_NOT_NULL(core);
|
||||||
_standardInit(core);
|
_standardInit(core);
|
||||||
|
|
||||||
|
|
|
@ -99,10 +99,16 @@ namespace ControlUnitTests
|
||||||
|
|
||||||
WEX::TestExecution::SetVerifyOutput verifyOutputScope{ WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures };
|
WEX::TestExecution::SetVerifyOutput verifyOutputScope{ WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures };
|
||||||
|
|
||||||
|
BEGIN_TEST_METHOD_PROPERTIES()
|
||||||
|
TEST_METHOD_PROPERTY(L"Data:useAcrylic", L"{true, false}")
|
||||||
|
END_TEST_METHOD_PROPERTIES()
|
||||||
|
bool useAcrylic;
|
||||||
|
VERIFY_SUCCEEDED(TestData::TryGetValue(L"useAcrylic", useAcrylic), L"whether or not we should enable acrylic");
|
||||||
|
|
||||||
auto [settings, conn] = _createSettingsAndConnection();
|
auto [settings, conn] = _createSettingsAndConnection();
|
||||||
|
|
||||||
settings->UseAcrylic(true);
|
settings->UseAcrylic(useAcrylic);
|
||||||
settings->TintOpacity(0.5f);
|
settings->Opacity(0.5f);
|
||||||
|
|
||||||
auto [core, interactivity] = _createCoreAndInteractivity(*settings, *conn);
|
auto [core, interactivity] = _createCoreAndInteractivity(*settings, *conn);
|
||||||
|
|
||||||
|
@ -110,16 +116,11 @@ namespace ControlUnitTests
|
||||||
double expectedOpacity = 0.5;
|
double expectedOpacity = 0.5;
|
||||||
auto opacityCallback = [&](auto&&, Control::TransparencyChangedEventArgs args) mutable {
|
auto opacityCallback = [&](auto&&, Control::TransparencyChangedEventArgs args) mutable {
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity, args.Opacity());
|
VERIFY_ARE_EQUAL(expectedOpacity, args.Opacity());
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity, settings->TintOpacity());
|
VERIFY_ARE_EQUAL(expectedOpacity, settings->Opacity());
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity, core->_settings.TintOpacity());
|
VERIFY_ARE_EQUAL(expectedOpacity, core->_settings.Opacity());
|
||||||
|
|
||||||
if (expectedOpacity < 1.0)
|
VERIFY_ARE_EQUAL(useAcrylic, settings->UseAcrylic());
|
||||||
{
|
VERIFY_ARE_EQUAL(useAcrylic, core->_settings.UseAcrylic());
|
||||||
VERIFY_IS_TRUE(settings->UseAcrylic());
|
|
||||||
VERIFY_IS_TRUE(core->_settings.UseAcrylic());
|
|
||||||
}
|
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity < 1.0, settings->UseAcrylic());
|
|
||||||
VERIFY_ARE_EQUAL(expectedOpacity < 1.0, core->_settings.UseAcrylic());
|
|
||||||
};
|
};
|
||||||
core->TransparencyChanged(opacityCallback);
|
core->TransparencyChanged(opacityCallback);
|
||||||
|
|
||||||
|
@ -157,7 +158,7 @@ namespace ControlUnitTests
|
||||||
|
|
||||||
// The mouse location and buttons don't matter here.
|
// The mouse location and buttons don't matter here.
|
||||||
interactivity->MouseWheel(modifiers,
|
interactivity->MouseWheel(modifiers,
|
||||||
30,
|
-30,
|
||||||
til::point{ 0, 0 },
|
til::point{ 0, 0 },
|
||||||
buttonState);
|
buttonState);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace ControlUnitTests
|
||||||
|
|
||||||
WINRT_PROPERTY(winrt::hstring, ProfileName);
|
WINRT_PROPERTY(winrt::hstring, ProfileName);
|
||||||
WINRT_PROPERTY(bool, UseAcrylic, false);
|
WINRT_PROPERTY(bool, UseAcrylic, false);
|
||||||
WINRT_PROPERTY(double, TintOpacity, 0.5);
|
WINRT_PROPERTY(double, Opacity, .5);
|
||||||
WINRT_PROPERTY(winrt::hstring, Padding, DEFAULT_PADDING);
|
WINRT_PROPERTY(winrt::hstring, Padding, DEFAULT_PADDING);
|
||||||
WINRT_PROPERTY(winrt::hstring, FontFace, L"Consolas");
|
WINRT_PROPERTY(winrt::hstring, FontFace, L"Consolas");
|
||||||
WINRT_PROPERTY(int32_t, FontSize, DEFAULT_FONT_SIZE);
|
WINRT_PROPERTY(int32_t, FontSize, DEFAULT_FONT_SIZE);
|
||||||
|
|
|
@ -47,7 +47,8 @@ namespace RemotingUnitTests
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is a silly helper struct.
|
// This is a silly helper struct.
|
||||||
// It will always throw an hresult_error on any of its methods.
|
// It will always throw an hresult_error of "RPC server is unavailable" on any of its methods.
|
||||||
|
// The monarch uses this particular error code to check for a dead peasant vs another exception.
|
||||||
//
|
//
|
||||||
// In the tests, it's hard to emulate a peasant process being totally dead
|
// In the tests, it's hard to emulate a peasant process being totally dead
|
||||||
// once the Monarch has captured a reference to it. Since everything's
|
// once the Monarch has captured a reference to it. Since everything's
|
||||||
|
@ -59,24 +60,24 @@ namespace RemotingUnitTests
|
||||||
struct DeadPeasant : implements<DeadPeasant, winrt::Microsoft::Terminal::Remoting::IPeasant>
|
struct DeadPeasant : implements<DeadPeasant, winrt::Microsoft::Terminal::Remoting::IPeasant>
|
||||||
{
|
{
|
||||||
DeadPeasant() = default;
|
DeadPeasant() = default;
|
||||||
void AssignID(uint64_t /*id*/) { throw winrt::hresult_error{}; };
|
void AssignID(uint64_t /*id*/) { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
uint64_t GetID() { throw winrt::hresult_error{}; };
|
uint64_t GetID() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
winrt::hstring WindowName() { throw winrt::hresult_error{}; };
|
winrt::hstring WindowName() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
winrt::hstring ActiveTabTitle() { throw winrt::hresult_error{}; };
|
winrt::hstring ActiveTabTitle() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
void ActiveTabTitle(const winrt::hstring& /*value*/) { throw winrt::hresult_error{}; };
|
void ActiveTabTitle(const winrt::hstring& /*value*/) { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
uint64_t GetPID() { throw winrt::hresult_error{}; };
|
uint64_t GetPID() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
bool ExecuteCommandline(const Remoting::CommandlineArgs& /*args*/) { throw winrt::hresult_error{}; }
|
bool ExecuteCommandline(const Remoting::CommandlineArgs& /*args*/) { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); }
|
||||||
void ActivateWindow(const Remoting::WindowActivatedArgs& /*args*/) { throw winrt::hresult_error{}; }
|
void ActivateWindow(const Remoting::WindowActivatedArgs& /*args*/) { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); }
|
||||||
void RequestIdentifyWindows() { throw winrt::hresult_error{}; };
|
void RequestIdentifyWindows() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
void DisplayWindowId() { throw winrt::hresult_error{}; };
|
void DisplayWindowId() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
Remoting::CommandlineArgs InitialArgs() { throw winrt::hresult_error{}; }
|
Remoting::CommandlineArgs InitialArgs() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); }
|
||||||
Remoting::WindowActivatedArgs GetLastActivatedArgs() { throw winrt::hresult_error{}; }
|
Remoting::WindowActivatedArgs GetLastActivatedArgs() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); }
|
||||||
void RequestRename(const Remoting::RenameRequestArgs& /*args*/) { throw winrt::hresult_error{}; }
|
void RequestRename(const Remoting::RenameRequestArgs& /*args*/) { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); }
|
||||||
void Summon(const Remoting::SummonWindowBehavior& /*args*/) { throw winrt::hresult_error{}; };
|
void Summon(const Remoting::SummonWindowBehavior& /*args*/) { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
void RequestShowNotificationIcon() { throw winrt::hresult_error{}; };
|
void RequestShowNotificationIcon() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
void RequestHideNotificationIcon() { throw winrt::hresult_error{}; };
|
void RequestHideNotificationIcon() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
void RequestQuitAll() { throw winrt::hresult_error{}; };
|
void RequestQuitAll() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
void Quit() { throw winrt::hresult_error{}; };
|
void Quit() { throw winrt::hresult_error(winrt::hresult{ (int32_t)0x800706ba }); };
|
||||||
TYPED_EVENT(WindowActivated, winrt::Windows::Foundation::IInspectable, Remoting::WindowActivatedArgs);
|
TYPED_EVENT(WindowActivated, winrt::Windows::Foundation::IInspectable, Remoting::WindowActivatedArgs);
|
||||||
TYPED_EVENT(ExecuteCommandlineRequested, winrt::Windows::Foundation::IInspectable, Remoting::CommandlineArgs);
|
TYPED_EVENT(ExecuteCommandlineRequested, winrt::Windows::Foundation::IInspectable, Remoting::CommandlineArgs);
|
||||||
TYPED_EVENT(IdentifyWindowsRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
|
TYPED_EVENT(IdentifyWindowsRequested, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
#include "NotificationIcon.h"
|
#include "NotificationIcon.h"
|
||||||
|
#include <dwmapi.h>
|
||||||
|
#include <TerminalThemeHelpers.h>
|
||||||
|
|
||||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||||
|
|
||||||
|
@ -59,7 +61,14 @@ void IslandWindow::MakeWindow() noexcept
|
||||||
// Create the window with the default size here - During the creation of the
|
// Create the window with the default size here - During the creation of the
|
||||||
// window, the system will give us a chance to set its size in WM_CREATE.
|
// window, the system will give us a chance to set its size in WM_CREATE.
|
||||||
// WM_CREATE will be handled synchronously, before CreateWindow returns.
|
// WM_CREATE will be handled synchronously, before CreateWindow returns.
|
||||||
WINRT_VERIFY(CreateWindowEx(_alwaysOnTop ? WS_EX_TOPMOST : 0,
|
//
|
||||||
|
// We need WS_EX_NOREDIRECTIONBITMAP for vintage style opacity, GH#603
|
||||||
|
//
|
||||||
|
// WS_EX_LAYERED acts REAL WEIRD with TerminalTrySetTransparentBackground,
|
||||||
|
// but it works just fine when the window is in the TOPMOST group. But if
|
||||||
|
// you enable it always, activating the window will remove our DWM frame
|
||||||
|
// entirely. Weird.
|
||||||
|
WINRT_VERIFY(CreateWindowEx(WS_EX_NOREDIRECTIONBITMAP | (_alwaysOnTop ? WS_EX_TOPMOST : 0),
|
||||||
wc.lpszClassName,
|
wc.lpszClassName,
|
||||||
L"Windows Terminal",
|
L"Windows Terminal",
|
||||||
WS_OVERLAPPEDWINDOW,
|
WS_OVERLAPPEDWINDOW,
|
||||||
|
@ -311,6 +320,10 @@ void IslandWindow::Initialize()
|
||||||
_taskbar = std::move(taskbar);
|
_taskbar = std::move(taskbar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable vintage opacity by removing the XAML emergency backstop, GH#603.
|
||||||
|
// We don't really care if this failed or not.
|
||||||
|
TerminalTrySetTransparentBackground(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IslandWindow::OnSize(const UINT width, const UINT height)
|
void IslandWindow::OnSize(const UINT width, const UINT height)
|
||||||
|
@ -424,6 +437,7 @@ long IslandWindow::_calculateTotalSize(const bool isWidth, const long clientSize
|
||||||
{
|
{
|
||||||
_WindowActivatedHandlers();
|
_WindowActivatedHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,7 +842,7 @@ void IslandWindow::SetTaskbarProgress(const size_t state, const size_t progress)
|
||||||
}
|
}
|
||||||
|
|
||||||
// From GdiEngine::s_SetWindowLongWHelper
|
// From GdiEngine::s_SetWindowLongWHelper
|
||||||
void _SetWindowLongWHelper(const HWND hWnd, const int nIndex, const LONG dwNewLong) noexcept
|
void SetWindowLongWHelper(const HWND hWnd, const int nIndex, const LONG dwNewLong) noexcept
|
||||||
{
|
{
|
||||||
// SetWindowLong has strange error handling. On success, it returns the
|
// SetWindowLong has strange error handling. On success, it returns the
|
||||||
// previous Window Long value and doesn't modify the Last Error state. To
|
// previous Window Long value and doesn't modify the Last Error state. To
|
||||||
|
@ -919,14 +933,14 @@ void IslandWindow::_SetIsBorderless(const bool borderlessEnabled)
|
||||||
|
|
||||||
// First, modify regular window styles as appropriate
|
// First, modify regular window styles as appropriate
|
||||||
auto windowStyle = _getDesiredWindowStyle();
|
auto windowStyle = _getDesiredWindowStyle();
|
||||||
_SetWindowLongWHelper(hWnd, GWL_STYLE, windowStyle);
|
SetWindowLongWHelper(hWnd, GWL_STYLE, windowStyle);
|
||||||
|
|
||||||
// Now modify extended window styles as appropriate
|
// Now modify extended window styles as appropriate
|
||||||
// When moving to fullscreen, remove the window edge style to avoid an
|
// When moving to fullscreen, remove the window edge style to avoid an
|
||||||
// ugly border when not focused.
|
// ugly border when not focused.
|
||||||
auto exWindowStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
auto exWindowStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||||
WI_UpdateFlag(exWindowStyle, WS_EX_WINDOWEDGE, !_fullscreen);
|
WI_UpdateFlag(exWindowStyle, WS_EX_WINDOWEDGE, !_fullscreen);
|
||||||
_SetWindowLongWHelper(hWnd, GWL_EXSTYLE, exWindowStyle);
|
SetWindowLongWHelper(hWnd, GWL_EXSTYLE, exWindowStyle);
|
||||||
|
|
||||||
// Resize the window, with SWP_FRAMECHANGED, to trigger user32 to
|
// Resize the window, with SWP_FRAMECHANGED, to trigger user32 to
|
||||||
// recalculate the non/client areas
|
// recalculate the non/client areas
|
||||||
|
@ -1064,14 +1078,14 @@ void IslandWindow::_SetIsFullscreen(const bool fullscreenEnabled)
|
||||||
|
|
||||||
// First, modify regular window styles as appropriate
|
// First, modify regular window styles as appropriate
|
||||||
auto windowStyle = _getDesiredWindowStyle();
|
auto windowStyle = _getDesiredWindowStyle();
|
||||||
_SetWindowLongWHelper(hWnd, GWL_STYLE, windowStyle);
|
SetWindowLongWHelper(hWnd, GWL_STYLE, windowStyle);
|
||||||
|
|
||||||
// Now modify extended window styles as appropriate
|
// Now modify extended window styles as appropriate
|
||||||
// When moving to fullscreen, remove the window edge style to avoid an
|
// When moving to fullscreen, remove the window edge style to avoid an
|
||||||
// ugly border when not focused.
|
// ugly border when not focused.
|
||||||
auto exWindowStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
auto exWindowStyle = GetWindowLongW(hWnd, GWL_EXSTYLE);
|
||||||
WI_UpdateFlag(exWindowStyle, WS_EX_WINDOWEDGE, !_fullscreen);
|
WI_UpdateFlag(exWindowStyle, WS_EX_WINDOWEDGE, !_fullscreen);
|
||||||
_SetWindowLongWHelper(hWnd, GWL_EXSTYLE, exWindowStyle);
|
SetWindowLongWHelper(hWnd, GWL_EXSTYLE, exWindowStyle);
|
||||||
|
|
||||||
// Only change the window position if changing fullscreen state.
|
// Only change the window position if changing fullscreen state.
|
||||||
if (fChangingFullscreen)
|
if (fChangingFullscreen)
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include <winrt/TerminalApp.h>
|
#include <winrt/TerminalApp.h>
|
||||||
#include "../../cascadia/inc/cppwinrt_utils.h"
|
#include "../../cascadia/inc/cppwinrt_utils.h"
|
||||||
|
|
||||||
|
void SetWindowLongWHelper(const HWND hWnd, const int nIndex, const LONG dwNewLong) noexcept;
|
||||||
|
|
||||||
class IslandWindow :
|
class IslandWindow :
|
||||||
public BaseWindow<IslandWindow>
|
public BaseWindow<IslandWindow>
|
||||||
{
|
{
|
||||||
|
|
|
@ -685,9 +685,18 @@ SIZE NonClientIslandWindow::GetTotalNonClientExclusiveSize(UINT dpi) const noexc
|
||||||
// - the HRESULT returned by DwmExtendFrameIntoClientArea.
|
// - the HRESULT returned by DwmExtendFrameIntoClientArea.
|
||||||
void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
|
void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
|
||||||
{
|
{
|
||||||
MARGINS margins = {};
|
MARGINS margins = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
if (_GetTopBorderHeight() != 0)
|
// GH#603: When we're in Focus Mode, hide the titlebar, by setting it to a single
|
||||||
|
// pixel tall. Otherwise, the titlebar will be visible underneath controls with
|
||||||
|
// vintage opacity set.
|
||||||
|
//
|
||||||
|
// We can't set it to all 0's unfortunately.
|
||||||
|
if (_borderless)
|
||||||
|
{
|
||||||
|
margins.cyTopHeight = 1;
|
||||||
|
}
|
||||||
|
else if (_GetTopBorderHeight() != 0)
|
||||||
{
|
{
|
||||||
RECT frame = {};
|
RECT frame = {};
|
||||||
winrt::check_bool(::AdjustWindowRectExForDpi(&frame, GetWindowStyle(_window.get()), FALSE, 0, _currentDpi));
|
winrt::check_bool(::AdjustWindowRectExForDpi(&frame, GetWindowStyle(_window.get()), FALSE, 0, _currentDpi));
|
||||||
|
@ -896,6 +905,10 @@ void NonClientIslandWindow::_SetIsBorderless(const bool borderlessEnabled)
|
||||||
_titlebar.Visibility(_IsTitlebarVisible() ? Visibility::Visible : Visibility::Collapsed);
|
_titlebar.Visibility(_IsTitlebarVisible() ? Visibility::Visible : Visibility::Collapsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the margins when entering/leaving focus mode, so we can prevent
|
||||||
|
// the titlebar from showing through transparent terminal controls
|
||||||
|
_UpdateFrameMargins();
|
||||||
|
|
||||||
// GH#4224 - When the auto-hide taskbar setting is enabled, then we don't
|
// GH#4224 - When the auto-hide taskbar setting is enabled, then we don't
|
||||||
// always get another window message to trigger us to remove the drag bar.
|
// always get another window message to trigger us to remove the drag bar.
|
||||||
// So, make sure to update the size of the drag region here, so that it
|
// So, make sure to update the size of the drag region here, so that it
|
||||||
|
|
|
@ -117,18 +117,18 @@
|
||||||
|
|
||||||
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
||||||
|
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets" Condition="Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets" Condition="Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.VCRTForwarders.140.1.0.4\build\native\Microsoft.VCRTForwarders.140.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.3.210521003\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.3.210521003\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.4.210908001\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.4.210908001\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Override GetPackagingOutputs to roll up all our dependencies.
|
<!-- Override GetPackagingOutputs to roll up all our dependencies.
|
||||||
|
@ -176,5 +176,5 @@
|
||||||
<!-- **END VC LIBS HACK** -->
|
<!-- **END VC LIBS HACK** -->
|
||||||
</Target>
|
</Target>
|
||||||
<Import Project="$(OpenConsoleDir)\build\rules\GenerateSxsManifestsFromWinmds.targets" />
|
<Import Project="$(OpenConsoleDir)\build\rules\GenerateSxsManifestsFromWinmds.targets" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.3.210521003\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets" Condition="Exists('..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.3.210521003\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.4.210908001\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets" Condition="Exists('..\..\..\packages\Microsoft.Internal.Windows.Terminal.ThemeHelpers.0.4.210908001\build\native\Microsoft.Internal.Windows.Terminal.ThemeHelpers.targets')" />
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
<package id="Microsoft.Windows.CppWinRT" version="2.0.210825.3" targetFramework="native" />
|
||||||
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
<package id="Microsoft.Toolkit.Win32.UI.XamlApplication" version="6.1.3" targetFramework="native" />
|
||||||
<package id="Microsoft.UI.Xaml" version="2.5.0-prerelease.201202003" targetFramework="native" />
|
<package id="Microsoft.UI.Xaml" version="2.7.0-prerelease.210913003" targetFramework="native" />
|
||||||
<package id="Microsoft.VCRTForwarders.140" version="1.0.4" targetFramework="native" />
|
<package id="Microsoft.VCRTForwarders.140" version="1.0.4" targetFramework="native" />
|
||||||
<package id="Microsoft.Internal.Windows.Terminal.ThemeHelpers" version="0.3.210521003" targetFramework="native" />
|
<package id="Microsoft.Internal.Windows.Terminal.ThemeHelpers" version="0.4.210908001" targetFramework="native" />
|
||||||
</packages>
|
</packages>
|
||||||
|
|
|
@ -67,6 +67,7 @@ Abstract:
|
||||||
#include <winrt/Windows.ui.xaml.media.h>
|
#include <winrt/Windows.ui.xaml.media.h>
|
||||||
#include <winrt/Windows.ApplicationModel.h>
|
#include <winrt/Windows.ApplicationModel.h>
|
||||||
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
#include <winrt/Windows.ApplicationModel.Resources.Core.h>
|
||||||
|
#include <winrt/Windows.UI.Composition.h>
|
||||||
|
|
||||||
#include <winrt/TerminalApp.h>
|
#include <winrt/TerminalApp.h>
|
||||||
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
#include <winrt/Microsoft.Terminal.Settings.Model.h>
|
||||||
|
|
|
@ -87,14 +87,14 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" />
|
||||||
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
<Import Project="..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets" Condition="Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\build\native\Microsoft.UI.Xaml.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\build\native\Microsoft.UI.Xaml.targets'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.props'))" />
|
||||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
<Error Condition="!Exists('..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Toolkit.Win32.UI.XamlApplication.6.1.3\build\native\Microsoft.Toolkit.Win32.UI.XamlApplication.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
<!-- From Microsoft.UI.Xaml.targets -->
|
<!-- From Microsoft.UI.Xaml.targets -->
|
||||||
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
|
||||||
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
|
||||||
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.5.0-prerelease.201202003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
<_MUXBinRoot>"$(OpenConsoleDir)packages\Microsoft.UI.Xaml.2.7.0-prerelease.210913003\runtimes\win10-$(Native-Platform)\native\"</_MUXBinRoot>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
|
|
Loading…
Reference in a new issue