From 05aad0f1ad0817ac6573831af7d1bff2204e79fd Mon Sep 17 00:00:00 2001
From: Serge <5920850+seerge@users.noreply.github.com>
Date: Tue, 23 May 2023 10:58:27 +0200
Subject: [PATCH] Matrix tweaks
---
app/AnimeMatrix/AniMatrix.cs | 2 +-
app/GHelper.csproj | 2 +-
app/NativeMethods.cs | 8 ----
app/Program.cs | 2 +-
app/Properties/Strings.fr.resx | 69 +++++++++++++++++++++++++++++++---
app/Settings.cs | 3 +-
6 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/app/AnimeMatrix/AniMatrix.cs b/app/AnimeMatrix/AniMatrix.cs
index b2c61936..72affaac 100644
--- a/app/AnimeMatrix/AniMatrix.cs
+++ b/app/AnimeMatrix/AniMatrix.cs
@@ -26,7 +26,7 @@ namespace GHelper.AnimeMatrix
try
{
mat = new AnimeMatrixDevice();
- //Task.Run(mat.WakeUp);
+ Task.Run(mat.WakeUp);
matrixTimer = new System.Timers.Timer(100);
matrixTimer.Elapsed += MatrixTimer_Elapsed;
}
diff --git a/app/GHelper.csproj b/app/GHelper.csproj
index b8a7cbba..f0a9aedc 100644
--- a/app/GHelper.csproj
+++ b/app/GHelper.csproj
@@ -16,7 +16,7 @@
AnyCPU
False
True
- 0.67
+ 0.68
diff --git a/app/NativeMethods.cs b/app/NativeMethods.cs
index 24a311f8..a4e211b5 100644
--- a/app/NativeMethods.cs
+++ b/app/NativeMethods.cs
@@ -709,14 +709,6 @@ public class NativeMethods
dm.dmDisplayFrequency = frequency;
int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
-
- // Retry as refresh rate can fail sometimes
- if (iRet == -1)
- {
- Thread.Sleep(500);
- iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
- Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
- }
return iRet;
}
diff --git a/app/Program.cs b/app/Program.cs
index 4f2b5200..1ced4947 100644
--- a/app/Program.cs
+++ b/app/Program.cs
@@ -44,7 +44,7 @@ namespace GHelper
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
Debug.WriteLine(CultureInfo.CurrentUICulture);
- //Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("zh");
+ //Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr");
CheckProcesses();
diff --git a/app/Properties/Strings.fr.resx b/app/Properties/Strings.fr.resx
index 41a23556..539d112c 100644
--- a/app/Properties/Strings.fr.resx
+++ b/app/Properties/Strings.fr.resx
@@ -1,5 +1,64 @@
+
@@ -89,10 +148,10 @@
G-Helper est déjà en cours d'exécution. Vérifiez la barre d'état du système
- Appliquer la courbe de ventilateur personnalisée
+ Appliquer le profil
- Appliquer les limites de performance
+ Appliquer les limites
Ajuster automatiquement les modes de Performance Windows
@@ -134,7 +193,7 @@
Balancé
- Limite de charge de la batterie
+ Limite de charge
Au lancement
@@ -188,7 +247,7 @@
Profil de ventilateur central
- Profil des ventilateurs
+ Profil
Ventilateurs et Puissance
@@ -353,7 +412,7 @@
Luminosité
- Ventilateurs :
+ Ventilateurs:
Boost Dynamique
diff --git a/app/Settings.cs b/app/Settings.cs
index 751c300e..5fdc2212 100644
--- a/app/Settings.cs
+++ b/app/Settings.cs
@@ -508,6 +508,7 @@ namespace GHelper
{
case 0:
Logger.WriteLine("Monitor Power Off");
+ AsusUSB.ApplyBrightness(0);
SetBatteryChargeLimit(AppConfig.getConfig("charge_limit"));
break;
case 1:
@@ -1311,7 +1312,7 @@ namespace GHelper
bool optimizedUSBC = AppConfig.getConfig("optimized_usbc") != 1;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
- (optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) != AsusACPI.ChargerUSB);
+ (optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB);
}