Fixed auto resolution switching in some exotic cases

This commit is contained in:
seerge
2023-03-14 15:39:56 +01:00
parent bc965c003d
commit 9bb5e41a5d
3 changed files with 31 additions and 23 deletions

View File

@@ -14,13 +14,19 @@ public static class Logger
Debug.WriteLine(logMessage);
if (!Directory.Exists(appPath)) Directory.CreateDirectory(appPath);
using (StreamWriter w = File.AppendText(logFile))
try
{
w.WriteLine($"{DateTime.Now}: {logMessage}");
using (StreamWriter w = File.AppendText(logFile))
{
w.WriteLine($"{DateTime.Now}: {logMessage}");
w.Close();
}
} catch
{
}
var rand = new Random();
if (rand.Next(50) == 1) Cleanup();
if (new Random().Next(100) == 1) Cleanup();
}
@@ -214,7 +220,9 @@ namespace GHelper
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
settingsForm.AutoPerformance(isPlugged);
settingsForm.AutoGPUMode(isPlugged);
bool switched = settingsForm.AutoGPUMode(isPlugged);
if (!switched) settingsForm.AutoScreen(isPlugged);
settingsForm.SetMatrix(isPlugged);
}