mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 13:42:24 +00:00
[macOS] fix: cant directly show window when click Show or hide the main window
on minimized
This commit is contained in:
parent
469967714c
commit
4bed4f9650
1 changed files with 22 additions and 22 deletions
|
@ -399,28 +399,28 @@ namespace v2rayN.Desktop.Views
|
|||
|
||||
public void ShowHideWindow(bool? blShow)
|
||||
{
|
||||
var bl = blShow ?? !_config.UiItem.ShowInTaskbar;
|
||||
if (bl)
|
||||
{
|
||||
this.Show();
|
||||
if (this.WindowState == WindowState.Minimized)
|
||||
{
|
||||
this.WindowState = WindowState.Normal;
|
||||
}
|
||||
this.Activate();
|
||||
this.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_config.UiItem.Hide2TrayWhenClose)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.WindowState = WindowState.Minimized;
|
||||
}
|
||||
}
|
||||
var bl = blShow ?? (!_config.UiItem.ShowInTaskbar ^ (WindowState==WindowState.Minimized));
|
||||
if (bl)
|
||||
{
|
||||
this.Show();
|
||||
if (this.WindowState == WindowState.Minimized)
|
||||
{
|
||||
this.WindowState = WindowState.Normal;
|
||||
}
|
||||
this.Activate();
|
||||
this.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utils.IsOSX() || _config.UiItem.Hide2TrayWhenClose)
|
||||
{
|
||||
this.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.WindowState = WindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
_config.UiItem.ShowInTaskbar = bl;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue