PowerControl: Consider the foreground process to be holding profile configuration

This commit is contained in:
Kamil Trzciński 2023-01-21 16:46:42 +01:00
parent 2f2f17ad05
commit 7daa4ac27f
2 changed files with 7 additions and 1 deletions

View file

@ -32,6 +32,7 @@ namespace CommonHelpers
public String ProcessName { get; set; }
public uint LastFrame { get; set; }
public DateTimeOffset LastFrameTime { get; set; }
public bool IsOSDForeground { get; set; }
public bool IsRecent
{
@ -60,6 +61,8 @@ namespace CommonHelpers
var now = DateTimeOffset.UtcNow;
var topLevelProcessId = GetTopLevelProcessId();
foreach (var app in appEntries)
{
if (!oldIDs.TryGetValue(app.ProcessId, out var entry))
@ -67,7 +70,9 @@ namespace CommonHelpers
entry.ProcessName = Path.GetFileNameWithoutExtension(app.Name);
}
if (entry.LastFrame != app.OSDFrameId)
entry.IsOSDForeground = (topLevelProcessId == app.ProcessId);
if (entry.LastFrame != app.OSDFrameId || entry.IsOSDForeground)
{
entry.LastFrame = app.OSDFrameId;
entry.LastFrameTime = now;

View file

@ -9,6 +9,7 @@
## 0.6.x
- PowerControl: Consider the foreground process to be holding profile configuration as long as it is running
- SteamController: Require administrator privileges
- PowerControl: Apply profile changes with a delay in bulk
- SteamController: Fix detection of the Steam client released around 2023-01-20, version: 1674182294