Compare commits

...

3 Commits

Author SHA1 Message Date
MutantAura
742df1cdc2
Merge 9cef4ceba4 into 5dbba07e33 2024-09-28 16:01:10 +02:00
e2dk4r
5dbba07e33
sdl: set app name (#7370)
Ryujinx was not hinting application name, so on some platforms (e.g.
Linux) volume control shows Ryujinx as 'SDL Application'. This can cause
confusion.

This commit fixes name in volume control applets on some platforms.

see: https://wiki.libsdl.org/SDL2/SDL_HINT_APP_NAME
2024-09-28 10:44:23 +02:00
MutantAura
9cef4ceba4 Remove event logic in favour of single init function. 2024-09-04 21:39:37 +01:00
4 changed files with 9 additions and 38 deletions

View File

@ -53,6 +53,7 @@ namespace Ryujinx.SDL2.Common
return;
}
SDL_SetHint(SDL_HINT_APP_NAME, "Ryujinx");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");

View File

@ -120,7 +120,6 @@ namespace Ryujinx.Ava
private readonly object _lockObject = new();
public event EventHandler AppExit;
public event EventHandler<StatusInitEventArgs> StatusInitEvent;
public event EventHandler<StatusUpdatedEventArgs> StatusUpdatedEvent;
public VirtualFileSystem VirtualFileSystem { get; }
@ -1044,14 +1043,14 @@ namespace Ryujinx.Ava
public void InitStatus()
{
StatusInitEvent?.Invoke(this, new StatusInitEventArgs(
ConfigurationState.Instance.Graphics.GraphicsBackend.Value switch
{
GraphicsBackend.Vulkan => "Vulkan",
GraphicsBackend.OpenGl => "OpenGL",
_ => throw new NotImplementedException()
},
$"GPU: {_renderer.GetHardwareInfo().GpuDriver}"));
_viewModel.BackendText = ConfigurationState.Instance.Graphics.GraphicsBackend.Value switch
{
GraphicsBackend.Vulkan => "Vulkan",
GraphicsBackend.OpenGl => "OpenGL",
_ => throw new NotImplementedException()
};
_viewModel.GpuNameText = $"GPU: {_renderer.GetHardwareInfo().GpuDriver}";
}
public void UpdateStatus()

View File

@ -1,16 +0,0 @@
using System;
namespace Ryujinx.Ava.UI.Models
{
internal class StatusInitEventArgs : EventArgs
{
public string GpuBackend { get; }
public string GpuName { get; }
public StatusInitEventArgs(string gpuBackend, string gpuName)
{
GpuBackend = gpuBackend;
GpuName = gpuName;
}
}
}

View File

@ -1182,7 +1182,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{
RendererHostControl.WindowCreated += RendererHost_Created;
AppHost.StatusInitEvent += Init_StatusBar;
AppHost.StatusUpdatedEvent += Update_StatusBar;
AppHost.AppExit += AppHost_AppExit;
@ -1209,18 +1208,6 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
private void Init_StatusBar(object sender, StatusInitEventArgs args)
{
if (ShowMenuAndStatusBar && !ShowLoadProgress)
{
Dispatcher.UIThread.InvokeAsync(() =>
{
GpuNameText = args.GpuName;
BackendText = args.GpuBackend;
});
}
}
private void Update_StatusBar(object sender, StatusUpdatedEventArgs args)
{
if (ShowMenuAndStatusBar && !ShowLoadProgress)