From 5f666b20d14c4fe1264ad863747e4f19db631283 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Mon, 28 Apr 2025 16:36:47 -0700 Subject: [PATCH] avoid wrong matching --- .../Common/PersistentWindowProcessor.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 20b9297..3634e4f 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -1568,10 +1568,16 @@ namespace PersistentWindows.Common { foreach (var dm in monitorApplications[curDisplayKey][h]) { + if (IsMinimized(h) != dm.IsMinimized) + continue; + if (User32.IsWindowVisible(h) == dm.IsInvisible) + continue; if (dm.ProcessName == procName) + { proc_name_match_cnt++; - if (dm.ClassName == className) - class_name_match_cnt++; + if (dm.ClassName == className) + class_name_match_cnt++; + } break; } }