mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[Settings]WinAppSDK 1.6 Flyout Fix (#34821)
Fixed titlebar and reverted W10 border hack
This commit is contained in:
committed by
GitHub
parent
5b0f3f64d4
commit
7640258c10
@@ -28,6 +28,13 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user