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