mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Screen Ruler] Don't flicker UI window at startup (#20206)
This commit is contained in:
@@ -39,9 +39,9 @@ namespace MeasureToolUI
|
||||
InitializeComponent();
|
||||
|
||||
var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
|
||||
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
|
||||
WindowId windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
|
||||
_appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
|
||||
var presenter = _appWindow.Presenter as OverlappedPresenter;
|
||||
presenter.IsAlwaysOnTop = true;
|
||||
this.SetIsAlwaysOnTop(true);
|
||||
@@ -61,7 +61,6 @@ namespace MeasureToolUI
|
||||
_initialPosition.Y,
|
||||
_initialPosition.X + (int)(dpiScale * WindowWidth),
|
||||
_initialPosition.Y + (int)(dpiScale * WindowHeight));
|
||||
|
||||
OnPositionChanged(_initialPosition);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user