move EnableGpu to config file as it will pop the restart needed message
MODIFY
WalletWasabi.Fluent.Desktop/Extensions/AppBuilderExtension.cs
WalletWasabi.Fluent.Desktop/Extensions/AppBuilderExtension.cs
@@ -9,7 +9,7 @@ public static class AppBuilderExtension
{
public static AppBuilder SetupAppBuilder(this AppBuilder appBuilder)
{
- bool enableGpu = Services.UiConfig.EnableGpu;
+ bool enableGpu = Services.Config.EnableGpu;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{

MODIFY
WalletWasabi.Fluent/Config.cs
WalletWasabi.Fluent/Config.cs
@@ -115,6 +115,9 @@ public class Config : ConfigBase
[JsonConverter(typeof(MoneyBtcJsonConverter))]
public Money DustThreshold { get; internal set; } = DefaultDustThreshold;
+ [JsonProperty(PropertyName = "EnableGpu")]
+ public bool EnableGpu { get; internal set; } = true;
+
public ServiceConfiguration ServiceConfiguration { get; private set; }
public Uri GetCurrentBackendUri()

MODIFY
WalletWasabi.Fluent/UiConfig.cs
WalletWasabi.Fluent/UiConfig.cs
@@ -51,9 +51,7 @@ public class UiConfig : ConfigBase
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ => ToFile());
- this.WhenAnyValue(
- x => x.SendAmountConversionReversed,
- x => x.EnableGpu)
+ this.WhenAnyValue(x => x.SendAmountConversionReversed)
.Throttle(TimeSpan.FromMilliseconds(500))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.MainThreadScheduler)
@@ -132,14 +130,6 @@ public class UiConfig : ConfigBase
set => RaiseAndSetIfChanged(ref _darkModeEnabled, value);
}
- [DefaultValue(true)]
- [JsonProperty(PropertyName = "EnableGpu", DefaultValueHandling = DefaultValueHandling.Populate)]
- public bool EnableGpu
- {
- get => _enableGpu;
- set => RaiseAndSetIfChanged(ref _enableGpu, value);
- }
-
[DefaultValue(null)]
[JsonProperty(PropertyName = "LastSelectedWallet", DefaultValueHandling = DefaultValueHandling.Populate)]
public string? LastSelectedWallet

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
@@ -36,7 +36,7 @@ public partial class GeneralSettingsTabViewModel : SettingsTabViewModelBase
public GeneralSettingsTabViewModel()
{
_darkModeEnabled = Services.UiConfig.DarkModeEnabled;
- _enableGpu = Services.UiConfig.EnableGpu;
+ _enableGpu = Services.Config.EnableGpu;
_autoCopy = Services.UiConfig.Autocopy;
_autoPaste = Services.UiConfig.AutoPaste;
_customChangeAddress = Services.UiConfig.IsCustomChangeAddress;
@@ -57,11 +57,6 @@ public partial class GeneralSettingsTabViewModel : SettingsTabViewModelBase
Navigate(NavigationTarget.CompactDialogScreen).To(new ThemeChangeViewModel(x ? Theme.Dark : Theme.Light));
});
- this.WhenAnyValue(x => x.EnableGpu)
- .ObserveOn(RxApp.TaskpoolScheduler)
- .Skip(1)
- .Subscribe(x => Services.UiConfig.EnableGpu = x);
-
this.WhenAnyValue(x => x.AutoCopy)
.ObserveOn(RxApp.TaskpoolScheduler)
.Skip(1)
@@ -104,7 +99,8 @@ public partial class GeneralSettingsTabViewModel : SettingsTabViewModelBase
this.WhenAnyValue(
x => x.UseTor,
- x => x.TerminateTorOnExit)
+ x => x.TerminateTorOnExit,
+ x => x.EnableGpu)
.ObserveOn(RxApp.TaskpoolScheduler)
.Throttle(TimeSpan.FromMilliseconds(ThrottleTime))
.Skip(1)
@@ -120,5 +116,6 @@ public partial class GeneralSettingsTabViewModel : SettingsTabViewModelBase
{
config.UseTor = UseTor;
config.TerminateTorOnExit = TerminateTorOnExit;
+ config.EnableGpu = EnableGpu;
}
}

move EnableGpu to config file as it will pop the restart needed message