Only apply font change when running under wine

This commit is contained in:
Natsumi
2024-11-30 23:33:15 +13:00
parent c4efb515e3
commit 110471c69c
15 changed files with 129 additions and 33 deletions

View File

@@ -603,5 +603,10 @@ namespace VRCX
return await ImageCache.SaveImageToFile(url, filePath);
}
public bool IsRunningUnderWine()
{
return Wine.GetIfWine();
}
}
}

View File

@@ -80,5 +80,10 @@ namespace VRCX
output = filePath;
return output;
}
public bool IsRunningUnderWine()
{
return Wine.GetIfWine();
}
}
}

View File

@@ -26,6 +26,11 @@ namespace VRCX
{
var isGameRunning = false;
var isSteamVRRunning = false;
if (ProcessMonitor.Instance.IsProcessRunning("VRChat"))
{
isGameRunning = true;
}
if (Wine.GetIfWine())
{
@@ -39,13 +44,6 @@ namespace VRCX
}
}
}
else
{
if (ProcessMonitor.Instance.IsProcessRunning("VRChat"))
{
isGameRunning = true;
}
}
if (ProcessMonitor.Instance.IsProcessRunning("vrserver"))
{

View File

@@ -11,6 +11,7 @@ using CefSharp.Structs;
using SharpDX.Direct3D11;
using System;
using System.Threading;
using NLog;
using SharpDX.Direct3D;
using SharpDX.Mathematics.Interop;
using Range = CefSharp.Structs.Range;
@@ -24,6 +25,8 @@ namespace VRCX
private DeviceMultithread _deviceMultithread;
private Query _query;
private Texture2D _renderTarget;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public OffScreenBrowser(string address, int width, int height)
: base(address, automaticallyCreateBrowser: false)
@@ -101,11 +104,20 @@ namespace VRCX
if (_device == null)
return;
using Texture2D cefTexture = _device1.OpenSharedResource1<Texture2D>(paintInfo.SharedTextureHandle);
_device.ImmediateContext.CopyResource(cefTexture, _renderTarget);
_device.ImmediateContext.End(_query);
_device.ImmediateContext.Flush();
try
{
using Texture2D cefTexture = _device1.OpenSharedResource1<Texture2D>(paintInfo.SharedTextureHandle);
_device.ImmediateContext.CopyResource(cefTexture, _renderTarget);
_device.ImmediateContext.End(_query);
_device.ImmediateContext.Flush();
}
catch (Exception e)
{
logger.Error(e);
_device = null;
return;
}
RawBool q = _device.ImmediateContext.GetData<RawBool>(_query, AsynchronousFlags.DoNotFlush);

View File

@@ -837,16 +837,16 @@ namespace VRCX
public override void ExecuteVrFeedFunction(string function, string json)
{
if (_wristOverlay == null) return;
if (_wristOverlay.IsLoading)
Restart();
// if (_wristOverlay.IsLoading)
// Restart();
_wristOverlay.ExecuteScriptAsync($"$app.{function}", json);
}
public override void ExecuteVrOverlayFunction(string function, string json)
{
if (_hmdOverlay == null) return;
if (_hmdOverlay.IsLoading)
Restart();
// if (_hmdOverlay.IsLoading)
// Restart();
_hmdOverlay.ExecuteScriptAsync($"$app.{function}", json);
}
}