mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Optimized mode switch from Ultimate
This commit is contained in:
@@ -173,7 +173,7 @@ namespace GHelper.Gpu
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AutoGPUMode()
|
public bool AutoGPUMode(bool optimized = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool GpuAuto = AppConfig.Is("gpu_auto");
|
bool GpuAuto = AppConfig.Is("gpu_auto");
|
||||||
@@ -186,8 +186,11 @@ namespace GHelper.Gpu
|
|||||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||||
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||||
|
|
||||||
if (mux == 0) // GPU in Ultimate, ignore
|
if (mux == 0)
|
||||||
|
{
|
||||||
|
if (optimized) SetGPUMode(AsusACPI.GPUModeStandard);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ public class Startup
|
|||||||
|
|
||||||
using (TaskDefinition td = TaskService.Instance.NewTask())
|
using (TaskDefinition td = TaskService.Instance.NewTask())
|
||||||
{
|
{
|
||||||
|
|
||||||
td.RegistrationInfo.Description = "G-Helper Auto Start";
|
td.RegistrationInfo.Description = "G-Helper Auto Start";
|
||||||
td.Triggers.Add(new LogonTrigger { UserId = userId });
|
td.Triggers.Add(new LogonTrigger { UserId = userId, Delay = TimeSpan.FromSeconds(1) });
|
||||||
td.Actions.Add(strExeFilePath);
|
td.Actions.Add(strExeFilePath);
|
||||||
|
|
||||||
if (ProcessHelper.IsUserAdministrator())
|
if (ProcessHelper.IsUserAdministrator())
|
||||||
|
|||||||
@@ -419,13 +419,6 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ButtonOptimized_Click(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
AppConfig.Set("gpu_auto", (AppConfig.Get("gpu_auto") == 1) ? 0 : 1);
|
|
||||||
VisualiseGPUMode();
|
|
||||||
gpuControl.AutoGPUMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
AppConfig.Set("screen_auto", 1);
|
AppConfig.Set("screen_auto", 1);
|
||||||
@@ -753,6 +746,13 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void ButtonOptimized_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.Set("gpu_auto", (AppConfig.Get("gpu_auto") == 1) ? 0 : 1);
|
||||||
|
VisualiseGPUMode();
|
||||||
|
gpuControl.AutoGPUMode(true);
|
||||||
|
}
|
||||||
|
|
||||||
private void ButtonStopGPU_Click(object? sender, EventArgs e)
|
private void ButtonStopGPU_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
gpuControl.KillGPUApps();
|
gpuControl.KillGPUApps();
|
||||||
|
|||||||
Reference in New Issue
Block a user