mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix first load issue
This commit is contained in:
parent
270f5b3ca0
commit
53cb94dc60
2 changed files with 14 additions and 1 deletions
|
|
@ -108,7 +108,12 @@ namespace Flow.Launcher.Core.Resource
|
|||
public void RefreshFrame()
|
||||
{
|
||||
IntPtr mainWindowPtr = new WindowInteropHelper(mainWindow).Handle;
|
||||
if (mainWindowPtr == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
HwndSource mainWindowSrc = HwndSource.FromHwnd(mainWindowPtr);
|
||||
if (mainWindowSrc == null)
|
||||
return;
|
||||
//mainWindowSrc.CompositionTarget.BackgroundColor = Color.FromArgb(0, 255, 181, 178);
|
||||
|
||||
ParameterTypes.MARGINS margins = new ParameterTypes.MARGINS();
|
||||
|
|
@ -136,7 +141,12 @@ namespace Flow.Launcher.Core.Resource
|
|||
|
||||
//SetWindowAccent();
|
||||
var dict = GetThemeResourceDictionary(Settings.Theme);
|
||||
if (dict == null)
|
||||
return;
|
||||
|
||||
var windowBorderStyle = dict["WindowBorderStyle"] as Style;
|
||||
if (windowBorderStyle == null)
|
||||
return;
|
||||
Methods.SetWindowAttribute(new WindowInteropHelper(mainWindow).Handle, DWMWINDOWATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE, 3);
|
||||
if (BlurEnabled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -181,7 +181,10 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnLoaded(object sender, RoutedEventArgs _)
|
||||
{
|
||||
ThemeManager.Instance.RefreshFrame();
|
||||
Dispatcher.BeginInvoke((Action)(() =>
|
||||
{
|
||||
ThemeManager.Instance.RefreshFrame();
|
||||
}), DispatcherPriority.Background);
|
||||
|
||||
// MouseEventHandler
|
||||
PreviewMouseMove += MainPreviewMouseMove;
|
||||
|
|
|
|||
Loading…
Reference in a new issue