Add Enable GPU general settings
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 useGpuLinux = true;
+ bool enableGpu = Services.UiConfig.EnableGpu;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
@@ -28,9 +28,9 @@ public static class AppBuilderExtension
}
return appBuilder
- .With(new Win32PlatformOptions { AllowEglInitialization = true, UseDeferredRendering = true, UseWindowsUIComposition = true })
- .With(new X11PlatformOptions { UseGpu = useGpuLinux, WmClass = "Wasabi Wallet" })
- .With(new AvaloniaNativePlatformOptions { UseDeferredRendering = true, UseGpu = true })
+ .With(new Win32PlatformOptions { AllowEglInitialization = enableGpu, UseDeferredRendering = true, UseWindowsUIComposition = true })
+ .With(new X11PlatformOptions { UseGpu = enableGpu, WmClass = "Wasabi Wallet" })
+ .With(new AvaloniaNativePlatformOptions { UseDeferredRendering = true, UseGpu = enableGpu })
.With(new MacOSPlatformOptions { ShowInDock = true });
}
}

MODIFY
WalletWasabi.Fluent/UiConfig.cs
WalletWasabi.Fluent/UiConfig.cs
@@ -24,6 +24,7 @@ public class UiConfig : ConfigBase
private bool _autoPaste;
private int _feeTarget;
private bool _sendAmountConversionReversed;
+ private bool _enableGpu;
public UiConfig() : base()
{
@@ -50,7 +51,9 @@ public class UiConfig : ConfigBase
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ => ToFile());
- this.WhenAnyValue(x => x.SendAmountConversionReversed)
+ this.WhenAnyValue(
+ x => x.SendAmountConversionReversed,
+ x => x.EnableGpu)
.Throttle(TimeSpan.FromMilliseconds(500))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.MainThreadScheduler)
@@ -129,6 +132,14 @@ 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/SearchBar/Sources/SettingsSource.cs
WalletWasabi.Fluent/ViewModels/SearchBar/Sources/SettingsSource.cs
@@ -34,6 +34,7 @@ public class SettingsSource : ISearchItemSource
new NonActionableSearchItem(new Setting<GeneralSettingsTabViewModel, bool>(_settingsPage.GeneralSettingsTab, b => b.TerminateTorOnExit), "Terminate Tor when Wasabi shuts down", "Settings", new List<string>(), "nav_settings_regular") { IsDefault = false },
new NonActionableSearchItem(new Setting<BitcoinTabSettingsViewModel, bool>(_settingsPage.BitcoinTabSettings, b => b.StartLocalBitcoinCoreOnStartup), "Start local Bitcoin core on startup", "Settings", new List<string>(), "nav_settings_regular") { IsDefault = false },
new NonActionableSearchItem(new Setting<BitcoinTabSettingsViewModel, bool>(_settingsPage.BitcoinTabSettings, b => b.StopLocalBitcoinCoreOnShutdown), "Stop local Bitcoin core on shutdown", "Settings", new List<string>(), "nav_settings_regular") { IsDefault = false },
+ new NonActionableSearchItem(new Setting<GeneralSettingsTabViewModel, bool>(_settingsPage.GeneralSettingsTab, b => b.EnableGpu), "Enable GPU", "Settings", new List<string>(), "nav_settings_regular") { IsDefault = false },
};
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
WalletWasabi.Fluent/ViewModels/Settings/GeneralSettingsTabViewModel.cs
@@ -17,12 +17,13 @@ namespace WalletWasabi.Fluent.ViewModels.Settings;
Keywords = new[]
{
"Settings", "General", "Bitcoin", "Dark", "Mode", "Run", "Wasabi", "Computer", "System", "Start", "Background", "Close",
- "Auto", "Copy", "Paste", "Addresses", "Custom", "Change", "Address", "Fee", "Display", "Format", "BTC", "sats"
+ "Auto", "Copy", "Paste", "Addresses", "Custom", "Change", "Address", "Fee", "Display", "Format", "BTC", "sats", "Enable", "GPU"
},
IconName = "settings_general_regular")]
public partial class GeneralSettingsTabViewModel : SettingsTabViewModelBase
{
[AutoNotify] private bool _darkModeEnabled;
+ [AutoNotify] private bool _enableGpu;
[AutoNotify] private bool _autoCopy;
[AutoNotify] private bool _autoPaste;
[AutoNotify] private bool _customChangeAddress;
@@ -35,6 +36,7 @@ public partial class GeneralSettingsTabViewModel : SettingsTabViewModelBase
public GeneralSettingsTabViewModel()
{
_darkModeEnabled = Services.UiConfig.DarkModeEnabled;
+ _enableGpu = Services.UiConfig.EnableGpu;
_autoCopy = Services.UiConfig.Autocopy;
_autoPaste = Services.UiConfig.AutoPaste;
_customChangeAddress = Services.UiConfig.IsCustomChangeAddress;
@@ -55,6 +57,11 @@ 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)

MODIFY
WalletWasabi.Fluent/Views/Settings/GeneralSettingsTabView.axaml
WalletWasabi.Fluent/Views/Settings/GeneralSettingsTabView.axaml
<ToggleSwitch IsChecked="{Binding DarkModeEnabled}" />
</DockPanel>
+ <DockPanel>
+ <TextBlock Text="Enable GPU" />
+ <ToggleSwitch IsChecked="{Binding EnableGpu}" />
+ </DockPanel>
+
<DockPanel>
<TextBlock Text="Run Wasabi when computer starts" />
<ToggleSwitch IsChecked="{Binding RunOnSystemStartup}" Command="{Binding StartupCommand}" />

Add Enable GPU general settings