mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-19 03:35:46 +00:00
@@ -57,7 +57,7 @@ namespace Ryujinx.Common.SystemInterop
|
||||
{
|
||||
string xdgSessionType = Environment.GetEnvironmentVariable("XDG_SESSION_TYPE")?.ToLower();
|
||||
|
||||
if (xdgSessionType == null || xdgSessionType == "x11")
|
||||
if (xdgSessionType is null or "x11")
|
||||
{
|
||||
nint display = XOpenDisplay(null);
|
||||
string dpiString = Marshal.PtrToStringAnsi(XGetDefault(display, "Xft", "dpi"));
|
||||
@@ -65,6 +65,7 @@ namespace Ryujinx.Common.SystemInterop
|
||||
{
|
||||
userDpiScale = XDisplayWidth(display, 0) * 25.4 / XDisplayWidthMM(display, 0);
|
||||
}
|
||||
|
||||
_ = XCloseDisplay(display);
|
||||
}
|
||||
else if (xdgSessionType == "wayland")
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace Ryujinx.Common.SystemInterop
|
||||
public partial class StdErrAdapter : IDisposable
|
||||
{
|
||||
private bool _disposable;
|
||||
private Stream _pipeReader;
|
||||
private Stream _pipeWriter;
|
||||
private FileStream _pipeReader;
|
||||
private FileStream _pipeWriter;
|
||||
private CancellationTokenSource _cancellationTokenSource;
|
||||
private Task _worker;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Ryujinx.Common.SystemInterop
|
||||
[SupportedOSPlatform("macos")]
|
||||
private async Task EventWorkerAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
using TextReader reader = new StreamReader(_pipeReader, leaveOpen: true);
|
||||
using StreamReader reader = new(_pipeReader, leaveOpen: true);
|
||||
string line;
|
||||
while (cancellationToken.IsCancellationRequested == false && (line = await reader.ReadLineAsync(cancellationToken)) != null)
|
||||
{
|
||||
@@ -92,13 +92,12 @@ namespace Ryujinx.Common.SystemInterop
|
||||
|
||||
[SupportedOSPlatform("linux")]
|
||||
[SupportedOSPlatform("macos")]
|
||||
private static Stream CreateFileDescriptorStream(int fd)
|
||||
private static FileStream CreateFileDescriptorStream(int fd)
|
||||
{
|
||||
return new FileStream(
|
||||
new SafeFileHandle(fd, ownsHandle: true),
|
||||
FileAccess.ReadWrite
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user