From 3a473bdc109e0d1f1acfbf8a3ed63bc70e896b25 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Mon, 5 May 2025 17:49:23 -0700 Subject: [PATCH] [dual pos switch] use first diff pos as background match --- .../Common/PersistentWindowProcessor.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index cfed54d..7ea75c3 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -2648,6 +2648,14 @@ namespace PersistentWindows.Common continue; } + if (!toForeground) + { + RECT screenPosition = new RECT(); + User32.GetWindowRect(hwnd, ref screenPosition); + if (screenPosition.Equals(metrics.ScreenPosition)) + continue; + } + IntPtr prevZwnd = metrics.PrevZorderWindow; if (prevZwnd != front_hwnd && (prevZwnd == IntPtr.Zero || prevZwnd != firstBackgroundWindow)) {