From b9cfa793b4f3f6f917156c6806ff9ee139e55543 Mon Sep 17 00:00:00 2001 From: mantaionut Date: Fri, 3 Jan 2025 09:22:25 +0200 Subject: [PATCH] Fix round corners crashing on 22000 --- src/modules/launcher/PowerLauncher/MainWindow.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs index f627116126eb..0968f3966f9a 100644 --- a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs +++ b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs @@ -192,7 +192,7 @@ private void OnSourceInitialized(object sender, EventArgs e) // Call RegisterHotKey only after a window handle can be used, so that a global hotkey can be registered. _viewModel.RegisterHotkey(_hwndSource.Handle); - if (OSVersionHelper.IsWindows11()) + if (OSVersionHelper.IsGreaterThanWindows11_21H2()) { // ResizeMode="NoResize" removes rounded corners. So force them to rounded. IntPtr hWnd = new WindowInteropHelper(GetWindow(this)).EnsureHandle(); @@ -203,6 +203,7 @@ private void OnSourceInitialized(object sender, EventArgs e) else { // On Windows10 ResizeMode="NoResize" removes the border so we add a new one. + // Also on 22000 it crashes due to DWMWA_WINDOW_CORNER_PREFERENCE https://github.com/microsoft/PowerToys/issues/36558 MainBorder.BorderThickness = new System.Windows.Thickness(0.5); } }