mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PTRun] Fix round corners crashing on 22000 (#36681)
Fix round corners crashing on 22000
This commit is contained in:
@@ -193,7 +193,7 @@ namespace PowerLauncher
|
|||||||
|
|
||||||
// Call RegisterHotKey only after a window handle can be used, so that a global hotkey can be registered.
|
// Call RegisterHotKey only after a window handle can be used, so that a global hotkey can be registered.
|
||||||
_viewModel.RegisterHotkey(_hwndSource.Handle);
|
_viewModel.RegisterHotkey(_hwndSource.Handle);
|
||||||
if (OSVersionHelper.IsWindows11())
|
if (OSVersionHelper.IsGreaterThanWindows11_21H2())
|
||||||
{
|
{
|
||||||
// ResizeMode="NoResize" removes rounded corners. So force them to rounded.
|
// ResizeMode="NoResize" removes rounded corners. So force them to rounded.
|
||||||
IntPtr hWnd = new WindowInteropHelper(GetWindow(this)).EnsureHandle();
|
IntPtr hWnd = new WindowInteropHelper(GetWindow(this)).EnsureHandle();
|
||||||
@@ -204,6 +204,7 @@ namespace PowerLauncher
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// On Windows10 ResizeMode="NoResize" removes the border so we add a new one.
|
// 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);
|
MainBorder.BorderThickness = new System.Windows.Thickness(0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user