Skip to content

Commit

Permalink
Skip auto-backlight when lid is closed #3335
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Nov 3, 2024
1 parent 54fdf92 commit ceb1c9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/Input/InputDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class InputDispatcher
{
System.Timers.Timer timer = new System.Timers.Timer(1000);
public static bool backlightActivity = true;
public static bool lidClose = false;

public static Keys keyProfile = (Keys)AppConfig.Get("keybind_profile", (int)Keys.F5);
public static Keys keyApp = (Keys)AppConfig.Get("keybind_app", (int)Keys.F12);
Expand Down Expand Up @@ -874,6 +875,7 @@ public static int GetBacklight()

public static void SetBacklightAuto(bool init = false)
{
if (lidClose) return;
if (init) Aura.Init();
Aura.ApplyBrightness(GetBacklight(), "Auto", init);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,14 @@ protected override void WndProc(ref Message m)
{
case 0:
Logger.WriteLine("Lid Closed");
InputDispatcher.lidClose = AniMatrixControl.lidClose = true;
Aura.ApplyBrightness(0, "Lid");
AniMatrixControl.lidClose = true;
matrixControl.SetLidMode();
break;
case 1:
Logger.WriteLine("Lid Open");
InputDispatcher.lidClose = AniMatrixControl.lidClose = false;
Aura.ApplyBrightness(InputDispatcher.GetBacklight(), "Lid");
AniMatrixControl.lidClose = false;
matrixControl.SetLidMode();
break;
}
Expand Down

0 comments on commit ceb1c9a

Please sign in to comment.