From eb21fb2020b6e87d0cadfc456e756662500d5d55 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sat, 9 Sep 2023 17:01:02 +0200 Subject: [PATCH] Backlight init delay --- app/AsusUSB.cs | 4 +++- app/Input/InputDispatcher.cs | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/AsusUSB.cs b/app/AsusUSB.cs index 25979ba0..bea0a235 100644 --- a/app/AsusUSB.cs +++ b/app/AsusUSB.cs @@ -333,13 +333,15 @@ namespace GHelper } - public static void ApplyBrightness(int brightness, string log = "Backlight") + public static void ApplyBrightness(int brightness, string log = "Backlight", bool delay = false) { Task.Run(async () => { + if (delay) await Task.Delay(TimeSpan.FromSeconds(1)); + if (isTuf) Program.acpi.TUFKeyboardBrightness(brightness); byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness }; diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 4a5871f1..05df04ca 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -599,9 +599,7 @@ namespace GHelper.Input public static void SetBacklightAuto(bool init = false) { if (init) AsusUSB.Init(); - - //if (!OptimizationService.IsRunning()) - AsusUSB.ApplyBrightness(GetBacklight(), "Auto"); + AsusUSB.ApplyBrightness(GetBacklight(), "Auto", init); } public static void SetBacklight(int delta, bool force = false)