mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-10 14:35:00 +03:00
Fix: AutoHideStartup's bug of displaying window before hiding it. (#8083)
* Fix: AutoHideStartup's bug of displaying window before hiding it.
* Disable AutoHideStartup for Linux
* Revert "Disable AutoHideStartup for Linux"
This reverts commit 09f27e3455.
---------
Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -31,6 +31,12 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
||||
_config = AppManager.Instance.Config;
|
||||
_manager = new WindowNotificationManager(TopLevel.GetTopLevel(this)) { MaxItems = 3, Position = NotificationPosition.TopRight };
|
||||
|
||||
if (_config.UiItem.AutoHideStartup)
|
||||
{
|
||||
this.ShowActivated = false;
|
||||
this.WindowState = WindowState.Minimized;
|
||||
}
|
||||
|
||||
this.KeyDown += MainWindow_KeyDown;
|
||||
menuSettingsSetUWP.Click += menuSettingsSetUWP_Click;
|
||||
menuPromotion.Click += menuPromotion_Click;
|
||||
@@ -438,6 +444,11 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
||||
protected override void OnLoaded(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
base.OnLoaded(sender, e);
|
||||
if (_config.UiItem.AutoHideStartup)
|
||||
{
|
||||
this.ShowHideWindow(false);
|
||||
_config.UiItem.ShowInTaskbar = true;
|
||||
}
|
||||
RestoreUI();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user