From 7daa4ac27f8d90dce81948bbb05353d7928a1f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Sat, 21 Jan 2023 16:46:42 +0100 Subject: [PATCH] PowerControl: Consider the foreground process to be holding profile configuration --- CommonHelpers/RTSS.cs | 7 ++++++- RELEASE.md | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CommonHelpers/RTSS.cs b/CommonHelpers/RTSS.cs index 12091e7..cd2fbac 100644 --- a/CommonHelpers/RTSS.cs +++ b/CommonHelpers/RTSS.cs @@ -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; diff --git a/RELEASE.md b/RELEASE.md index 82f03e3..0dc19e3 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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