mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-30 14:56:19 +00:00
修复:后台启动时,窗口会闪一下的问题
This commit is contained in:
parent
d3a0b44247
commit
b793f92a73
2 changed files with 16 additions and 5 deletions
|
@ -33,7 +33,15 @@ public partial class App : Application
|
|||
AppHandler.Instance.InitComponents();
|
||||
|
||||
desktop.Exit += OnExit;
|
||||
desktop.MainWindow = new MainWindow();
|
||||
var mainWindow = new MainWindow();
|
||||
if (!AppHandler.Instance.Config.UiItem.AutoHideStartup)
|
||||
{
|
||||
desktop.MainWindow = mainWindow;
|
||||
}
|
||||
else
|
||||
{
|
||||
desktop.MainWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
|
|
|
@ -76,6 +76,8 @@ namespace v2rayN.Desktop.Views
|
|||
private void RefreshIcon()
|
||||
{
|
||||
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
{
|
||||
if (desktop.MainWindow != null)
|
||||
{
|
||||
desktop.MainWindow.Icon = AvaUtils.GetAppIcon(_config.SystemProxyItem.SysProxyType);
|
||||
var iconslist = TrayIcon.GetIcons(Application.Current);
|
||||
|
@ -83,6 +85,7 @@ namespace v2rayN.Desktop.Views
|
|||
TrayIcon.SetIcons(Application.Current, iconslist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TxtRunningServerDisplay_Tapped(object? sender, Avalonia.Input.TappedEventArgs e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue