Optimized USB-C fix

This commit is contained in:
Serge
2023-08-05 13:17:50 +02:00
parent fa3d9d1f81
commit 0fec4c9620
4 changed files with 10 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.105</AssemblyVersion>
<AssemblyVersion>0.106</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -176,10 +176,14 @@ namespace GHelper.Gpu
public static bool IsPlugged()
{
bool optimizedUSBC = AppConfig.Get("optimized_usbc") != 1;
if (SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) return false;
if (!AppConfig.Is("optimized_usbc")) return true;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) < AsusACPI.ChargerUSB);
int chargerMode = Program.acpi.DeviceGet(AsusACPI.ChargerMode);
Logger.WriteLine("ChargerStatus: " + chargerMode);
if (chargerMode < 0) return true;
return (chargerMode & AsusACPI.ChargerBarrel) > 0;
}

View File

@@ -436,7 +436,6 @@ namespace GHelper.Input
KeyProcess("paddle");
return;
// The Command Center ("play-looking") button below the select key.
// We'll call this M3.
case 166:
KeyProcess("cc");
return;

View File

@@ -438,7 +438,7 @@ namespace GHelper
// checkStartup
//
checkStartup.AutoSize = true;
checkStartup.Location = new Point(36, 11);
checkStartup.Location = new Point(24, 11);
checkStartup.Margin = new Padding(11, 5, 11, 5);
checkStartup.Name = "checkStartup";
checkStartup.Size = new Size(206, 36);
@@ -1202,7 +1202,7 @@ namespace GHelper
labelCharge.Dock = DockStyle.Right;
labelCharge.ForeColor = SystemColors.ControlDark;
labelCharge.Location = new Point(365, 0);
labelCharge.Margin = new Padding(0, 0, 0, 0);
labelCharge.Margin = new Padding(0);
labelCharge.Name = "labelCharge";
labelCharge.Padding = new Padding(0, 0, 20, 0);
labelCharge.Size = new Size(462, 56);