Skip to content

Commit

Permalink
Merge branch 'main' into dev/ani/advanced-paste-additional-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
drawbyperpetual committed Sep 13, 2024
2 parents e61460d + a536ec6 commit 7dc0f7f
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 112 deletions.
13 changes: 12 additions & 1 deletion .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,22 @@ configuration:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: 'I would [like|love] [to help|helping|to contribute|contributing|to implement|implementing|to fix|fixing]'
pattern: "I(( would|'d) (like|love|be happy)| want) (to help|helping|to contribute|contributing|to implement|implementing|to fix|fixing)"
isRegex: True
then:
- addReply:
reply: Hi! Your last comment indicates to our system, that you might want to contribute to this feature/fix this bug. Thank you! Please make us aware on our ["Would you like to contribute to PowerToys?" thread](https://github.com/microsoft/PowerToys/issues/28769), as we don't see all the comments. <br /><br />_I'm a bot (beep!) so please excuse any mistakes I may make_
description:
- if:
- payloadType: Issues
- isAction:
action: Opened
- bodyContains:
pattern: 'Area\(s\) with issue\?\s*\nWorkspaces'
isRegex: True
then:
- addLabel:
label: Product-Workspaces
description:
onFailure:
onSuccess:
2 changes: 1 addition & 1 deletion .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.Universal",
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
"Microsoft.VisualStudio.Component.Windows10SDK.20348",
"Microsoft.VisualStudio.Component.Windows10SDK.22621",
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
"Microsoft.VisualStudio.Component.UWP.VC.ARM64",
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre",
Expand Down
11 changes: 5 additions & 6 deletions Cpp.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,16 @@
</Link>
</ItemDefinitionGroup>

<!-- Global props -->
<PropertyGroup Label="Globals"
Condition="'$(OverrideWindowsTargetPlatformVersion)'!='True'">
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
<TargetPlatformVersion>10.0.20348.0</TargetPlatformVersion>
<!-- Global props OverrideWindowsTargetPlatformVersion-->
<PropertyGroup Label="Globals">
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>

<!-- Props that are constant for both Debug and Release configurations -->
<PropertyGroup Label="Configuration">
<PlatformToolset Condition="'$(OverridePlatformToolset)'!='True'">v143</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<DesktopCompatible>true</DesktopCompatible>
<SpectreMitigation>Spectre</SpectreMitigation>
Expand Down
16 changes: 8 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<PackageVersion Include="Appium.WebDriver" Version="4.4.5" />
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.12" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Collections" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.0.240109" />
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Collections" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.1.240821" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
<PackageVersion Include="ControlzEx" Version="6.0.0" />
Expand Down
16 changes: 8 additions & 8 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1299,14 +1299,14 @@ EXHIBIT A -Mozilla Public License.
- Appium.WebDriver 4.4.5
- Azure.AI.OpenAI 1.0.0-beta.12
- CommunityToolkit.Mvvm 8.2.2
- CommunityToolkit.WinUI.Animations 8.0.240109
- CommunityToolkit.WinUI.Collections 8.0.240109
- CommunityToolkit.WinUI.Controls.Primitives 8.0.240109
- CommunityToolkit.WinUI.Controls.Segmented 8.0.240109
- CommunityToolkit.WinUI.Controls.SettingsControls 8.0.240109
- CommunityToolkit.WinUI.Controls.Sizers 8.0.240109
- CommunityToolkit.WinUI.Converters 8.0.240109
- CommunityToolkit.WinUI.Extensions 8.0.240109
- CommunityToolkit.WinUI.Animations 8.1.240821
- CommunityToolkit.WinUI.Collections 8.1.240821
- CommunityToolkit.WinUI.Controls.Primitives 8.1.240821
- CommunityToolkit.WinUI.Controls.Segmented 8.1.240821
- CommunityToolkit.WinUI.Controls.SettingsControls 8.1.240821
- CommunityToolkit.WinUI.Controls.Sizers 8.1.240821
- CommunityToolkit.WinUI.Converters 8.1.240821
- CommunityToolkit.WinUI.Extensions 8.1.240821
- CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.2
- CommunityToolkit.WinUI.UI.Controls.Markdown 7.1.2
- ControlzEx 6.0.0
Expand Down
4 changes: 2 additions & 2 deletions src/Common.Dotnet.CsWinRT.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!-- Some items may be set in Directory.Build.props in root -->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WindowsSdkPackageVersion>10.0.20348.38</WindowsSdkPackageVersion>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<WindowsSdkPackageVersion>10.0.22621.38</WindowsSdkPackageVersion>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/CropAndLock/CropAndLock/CropAndLock.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ProjectGuid>{f5e1146e-b7b3-4e11-85fd-270a500bd78c}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CropAndLock</RootNamespace>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.20348.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.22621.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ProjectGuid>{c604b37e-9d0e-4484-8778-e8b31b0e1b3a}</ProjectGuid>
<ProjectName>PowerToys.FileLocksmithLib.Interop</ProjectName>
<RootNamespace>PowerToys.FileLocksmithLib.Interop</RootNamespace>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutDir>
<TargetName>PowerToys.FileLocksmithLib.Interop</TargetName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)\WinUI3Apps</PublishDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
<AppxPackage>false</AppxPackage>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<OverrideWindowsTargetPlatformVersion>true</OverrideWindowsTargetPlatformVersion>
<!-- Even though these are defined in Cpp.Build.props some of the other props referred here override these vales, so we need to specify them. -->
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
<UseWinUI>true</UseWinUI>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
Expand Down
14 changes: 13 additions & 1 deletion src/modules/Workspaces/WorkspacesLib/WorkspacesLib.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{b31fcc55-b5a4-4ea7-b414-2dceae6af332}</ProjectGuid>
Expand Down Expand Up @@ -49,8 +50,19 @@
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\..\deps\spdlog.props" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<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>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/modules/Workspaces/WorkspacesLib/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
</packages>
15 changes: 0 additions & 15 deletions src/modules/alwaysontop/AlwaysOnTop/WindowCornersUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@

#include <dwmapi.h>

// Placeholder enums since dwmapi.h doesn't have these until SDK 22000.
// TODO: Remove once SDK targets 22000 or above.
enum DWMWINDOWATTRIBUTE_CUSTOM
{
DWMWA_WINDOW_CORNER_PREFERENCE = 33
};

enum DWM_WINDOW_CORNER_PREFERENCE
{
DWMWCP_DEFAULT = 0,
DWMWCP_DONOTROUND = 1,
DWMWCP_ROUND = 2,
DWMWCP_ROUNDSMALL = 3
};

int WindowCornerUtils::CornerPreference(HWND window) noexcept
{
int cornerPreference = -1;
Expand Down
16 changes: 0 additions & 16 deletions src/modules/fancyzones/FancyZonesLib/WindowUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ namespace NonLocalizable
const wchar_t SystemAppsFolder[] = L"SYSTEMAPPS";
}

// Placeholder enums since dwmapi.h doesn't have these until SDK 22000.
// TODO: Remove once SDK targets 22000 or above.
enum DWMWINDOWATTRIBUTE_CUSTOM
{
DWMWA_WINDOW_CORNER_PREFERENCE = 33

};

enum DWM_WINDOW_CORNER_PREFERENCE
{
DWMWCP_DEFAULT = 0,
DWMWCP_DONOTROUND = 1,
DWMWCP_ROUND = 2,
DWMWCP_ROUNDSMALL = 3
};

namespace
{
BOOL CALLBACK saveDisplayToVector(HMONITOR monitor, HDC /*hdc*/, LPRECT /*rect*/, LPARAM data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<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>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)</PublishDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)</PublishDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)</PublishDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)</PublishDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)</PublishDir>
Expand Down
3 changes: 2 additions & 1 deletion src/settings-ui/Settings.UI/Helpers/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
{
public static class NativeMethods
{
private const int GWL_STYLE = -16;
private const int WS_POPUP = 1 << 31; // 0x80000000
internal const int GWL_STYLE = -16;
internal const int WS_CAPTION = 0x00C00000;
internal const int SPI_GETDESKWALLPAPER = 0x0073;
internal const int SW_SHOWNORMAL = 1;
internal const int SW_SHOWMAXIMIZED = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)\WinUI3Apps</PublishDir>
Expand Down
13 changes: 0 additions & 13 deletions src/settings-ui/Settings.UI/SettingsXAML/FlyoutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flyout="using:Microsoft.PowerToys.Settings.UI.Flyout"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:ic="using:Microsoft.Xaml.Interactions.Core"
xmlns:local="using:Microsoft.PowerToys.Settings.UI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:winuiex="using:WinUIEx"
Expand All @@ -29,17 +27,6 @@
LightTintOpacity="0" />
</winuiex:WindowEx.Backdrop>
<Grid>
<!-- HACK: https://github.com/microsoft/microsoft-ui-xaml/issues/7629 -->
<!-- W11 grey border, W10: no border -->
<i:Interaction.Behaviors>
<ic:DataTriggerBehavior
Binding="{x:Bind ViewModel.Windows10}"
ComparisonCondition="Equal"
Value="True">
<ic:ChangePropertyAction PropertyName="BorderThickness" Value="1" />
<ic:ChangePropertyAction PropertyName="BorderBrush" Value="{ThemeResource SurfaceStrokeColorDefaultBrush}" />
</ic:DataTriggerBehavior>
</i:Interaction.Behaviors>
<flyout:ShellPage x:Name="FlyoutShellPage" />
</Grid>
</winuiex:WindowEx>
7 changes: 7 additions & 0 deletions src/settings-ui/Settings.UI/SettingsXAML/FlyoutWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public sealed partial class FlyoutWindow : WindowEx
public FlyoutWindow(POINT? initialPosition)
{
this.InitializeComponent();

// Remove the caption style from the window style. Windows App SDK 1.6 added it, which made the title bar and borders appear for the Flyout. This code removes it.
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
var windowStyle = NativeMethods.GetWindowLong(hwnd, NativeMethods.GWL_STYLE);
windowStyle &= ~NativeMethods.WS_CAPTION;
_ = NativeMethods.SetWindowLong(hwnd, NativeMethods.GWL_STYLE, windowStyle);

this.Activated += FlyoutWindow_Activated;
FlyoutAppearPosition = initialPosition;
ViewModel = new FlyoutViewModel();
Expand Down
Loading

0 comments on commit 7dc0f7f

Please sign in to comment.