Add HideOnClose setting
MODIFY
WalletWasabi.Fluent/App.axaml.cs
WalletWasabi.Fluent/App.axaml.cs
using System;
using System.Reactive.Concurrency;
+using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
@@ -79,7 +80,21 @@ namespace WalletWasabi.Fluent
{
if (CanShutdownProvider is { } provider)
{
- e.Cancel = !provider.CanShutdown();
+ bool hideOnClose = Services.UiConfig.HideOnClose;
+ e.Cancel = !provider.CanShutdown() || hideOnClose;
+
+ if (hideOnClose)
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ // Todo: hide the window and hide taskbar icon as well
+ MainViewModel.Instance!.WindowState = WindowState.Minimized;
+ }
+ else
+ {
+ MainViewModel.Instance!.WindowState = WindowState.Minimized;
+ }
+ }
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
@@ -31,6 +31,7 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
[AutoNotify] private bool _customChangeAddress;
[AutoNotify] private FeeDisplayFormat _selectedFeeDisplayFormat;
[AutoNotify] private bool _runOnSystemStartup;
+ [AutoNotify] private bool _hideOnClose;
public GeneralSettingsTabViewModel()
{
@@ -39,6 +40,7 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
_customFee = Services.UiConfig.IsCustomFee;
_customChangeAddress = Services.UiConfig.IsCustomChangeAddress;
_runOnSystemStartup = Services.UiConfig.RunOnSystemStartup;
+ _hideOnClose = Services.UiConfig.HideOnClose;
_selectedFeeDisplayFormat = Enum.IsDefined(typeof(FeeDisplayFormat), Services.UiConfig.FeeDisplayFormat)
? (FeeDisplayFormat)Services.UiConfig.FeeDisplayFormat
: FeeDisplayFormat.SatoshiPerByte;
@@ -86,6 +88,11 @@ namespace WalletWasabi.Fluent.ViewModels.Settings
.ObserveOn(RxApp.MainThreadScheduler)
.Skip(1)
.Subscribe(x => Services.UiConfig.FeeDisplayFormat = (int)x);
+
+ this.WhenAnyValue(x => x.HideOnClose)
+ .ObserveOn(RxApp.TaskpoolScheduler)
+ .Skip(1)
+ .Subscribe(x => Services.UiConfig.HideOnClose = x);
}
public ICommand StartupCommand { get; }

MODIFY
WalletWasabi.Fluent/Views/Settings/GeneralSettingsTabView.axaml
WalletWasabi.Fluent/Views/Settings/GeneralSettingsTabView.axaml
<ToggleSwitch IsChecked="{Binding RunOnSystemStartup}" Command="{Binding StartupCommand}" />
</DockPanel>
+ <DockPanel>
+ <TextBlock Text="Hide Window on close" />
+ <ToggleSwitch IsChecked="{Binding HideOnClose}" />
+ </DockPanel>
+
<DockPanel>
<TextBlock Text="Auto Copy/Paste Bitcoin addresses" />
<ToggleSwitch IsChecked="{Binding AutoCopy}" />

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -26,6 +26,7 @@ namespace WalletWasabi.Gui
private string _windowState = "Normal";
private bool _runOnSystemStartup;
private bool _oobe;
+ private bool _hideOnClose;
public UiConfig() : base()
{
@@ -45,7 +46,8 @@ namespace WalletWasabi.Gui
x => x.Oobe,
x => x.RunOnSystemStartup,
x => x.PrivacyMode,
- (_, _, _, _, _, _, _, _, _, _, _) => Unit.Default)
+ x => x.HideOnClose,
+ (_, _, _, _, _, _, _, _, _, _, _, _) => Unit.Default)
.Throttle(TimeSpan.FromMilliseconds(500))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.TaskpoolScheduler)
@@ -167,5 +169,13 @@ namespace WalletWasabi.Gui
[JsonProperty(PropertyName = "HistoryTabViewSortingPreference")]
[JsonConverter(typeof(SortingPreferenceJsonConverter))]
public SortingPreference HistoryTabViewSortingPreference { get; internal set; } = new SortingPreference(SortOrder.Decreasing, "Date");
+
+ [DefaultValue(false)]
+ [JsonProperty(PropertyName = "HideOnClose", DefaultValueHandling = DefaultValueHandling.Populate)]
+ public bool HideOnClose
+ {
+ get => _hideOnClose;
+ set => RaiseAndSetIfChanged(ref _hideOnClose, value);
+ }
}
}

Add HideOnClose setting