From c501e4daec54faabc5232cc8bbab5c52ad745cfb Mon Sep 17 00:00:00 2001 From: "M. AL-hejji" Date: Sun, 24 May 2026 18:27:11 +0300 Subject: [PATCH] v1.6.15: PotPlayer added to default ExcludedApps + migration framework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User report: dragging PotPlayer's (custom-chrome) title bar or double-clicking on the video area fires SnapActions's capture cascade. WM_COPY and the new v1.6.13 UIA layer both return empty (no text element), then the Ctrl+Insert fallback fires — PotPlayer interprets Ctrl+Insert as a non-copy shortcut, so the keystroke becomes a phantom input rather than a no-op. Fix: - AppSettings.cs: new ExcludedAppsDefaultsVersion property (default 0) tracking which generation of default-exclusions this file has absorbed. - SettingsManager.cs: new MigrateExcludedAppsDefaults run during Load, walks through ExcludedAppsDefaultsHistory and appends entries the file hasn't seen yet. Idempotent (dedup check), user-respecting (only ever adds, never removes). - ExcludedAppsDefaultsHistory[0] = PotPlayerMini64, PotPlayerMini (v1.6.15). Existing users upgrade to 1.6.15 → first time they trigger any save the ExcludedAppsDefaultsVersion bumps to 1 and PotPlayer entries persist. Users who want capture in PotPlayer can remove them via Settings → Excluded apps; the version is already 1 so they won't come back. The migration framework also gives us a clean knob for the next 'this app mis-fires Ctrl+Insert' report: append a new (version, apps) row. --- SnapActions/Config/AppSettings.cs | 9 ++++++++ SnapActions/Config/SettingsManager.cs | 32 +++++++++++++++++++++++++++ SnapActions/SnapActions.csproj | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/SnapActions/Config/AppSettings.cs b/SnapActions/Config/AppSettings.cs index 6a5d753..66d546f 100644 --- a/SnapActions/Config/AppSettings.cs +++ b/SnapActions/Config/AppSettings.cs @@ -79,6 +79,15 @@ public class AppSettings "KeePass", "KeePassXC", "1Password", "Bitwarden", "Dashlane", "Enpass", "LastPass", "RoboForm", "NordPass", "ProtonPass", "KeeperPasswordManager" ]; + /// + /// Tracks which "default ExcludedApps additions" generation this settings file has + /// already absorbed. SettingsManager.MigrateExcludedAppsDefaults merges new entries + /// forward on Load — users upgrading from an earlier version pick up newly-added + /// exclusions automatically without overwriting their own customizations. Removing + /// an entry sticks because we only ever *add*, and we only add once per generation. + /// + public int ExcludedAppsDefaultsVersion { get; set; } = 0; + public bool ReplaceSelectionOnTransform { get; set; } = true; /// diff --git a/SnapActions/Config/SettingsManager.cs b/SnapActions/Config/SettingsManager.cs index 991fc30..dd8a301 100644 --- a/SnapActions/Config/SettingsManager.cs +++ b/SnapActions/Config/SettingsManager.cs @@ -43,10 +43,42 @@ public static void Load() // Migrate: update built-in search engines to latest defaults MigrateSearchEngines(); MigrateActionIds(); + MigrateExcludedAppsDefaults(); PruneStaleActionIds(); PruneStaleBackups(); } + /// + /// Newly-added default ExcludedApps entries, grouped by the version that introduced them. + /// Each existing settings.json moves forward through this list once — users keep their + /// own additions, and any entry they explicitly remove stays removed because we record + /// the highest applied version in ExcludedAppsDefaultsVersion. New entries should + /// always be appended with the next sequential version. + /// + private static readonly (int Version, string[] Apps)[] ExcludedAppsDefaultsHistory = + { + // v1.6.15: PotPlayer reacts to a synthetic Ctrl+Insert (the capture-cascade's last + // resort) as a non-copy shortcut, and its custom-chrome title bar reports as client + // area to NCHITTEST so a drag-as-title-bar isn't suppressed earlier. Excluding it + // entirely is the surgical fix for the user-reported interference; users who do want + // capture in PotPlayer can remove these from Settings → Excluded apps. + (Version: 1, Apps: new[] { "PotPlayerMini64", "PotPlayerMini" }), + }; + + private static void MigrateExcludedAppsDefaults() + { + foreach (var (version, apps) in ExcludedAppsDefaultsHistory) + { + if (Current.ExcludedAppsDefaultsVersion >= version) continue; + foreach (var app in apps) + { + if (!Current.ExcludedApps.Any(e => e.Equals(app, StringComparison.OrdinalIgnoreCase))) + Current.ExcludedApps.Add(app); + } + Current.ExcludedAppsDefaultsVersion = version; + } + } + /// /// Keep only the 5 most recent settings.json.broken-* backups. Without this, repeated load /// failures (dying disk, AV scanner racing) accumulate junk in %AppData%\SnapActions forever. diff --git a/SnapActions/SnapActions.csproj b/SnapActions/SnapActions.csproj index 4b8bd9e..38ab19a 100644 --- a/SnapActions/SnapActions.csproj +++ b/SnapActions/SnapActions.csproj @@ -11,7 +11,7 @@ app.manifest SnapActions SnapActions - 1.6.14 + 1.6.15 $(NoWarn);WFO0003